Skip to main content

Const

Struct Const 

Source
pub struct Const<'st, T>(/* private fields */);
Expand description

This struct wraps specific instances of other terms to indicate that they are constant. Constants are named terms whose value can be extracted from a model using Model::eval.

To construct a Const<'st, T> call T::new_const where T implements Sort.

Implementations§

Source§

impl<'st, T> Const<'st, T>

Source

pub fn name(&self) -> &'st str

The name of the constant

Trait Implementations§

Source§

impl<'st> Add<Const<'st, Int<'st>>> for i64

Source§

type Output = Int<'st>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Const<'st, Int<'st>>) -> Self::Output

Performs the + operation. Read more
Source§

impl<'st> Add<Const<'st, Real<'st>>> for f64

Source§

type Output = Real<'st>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: Const<'st, Real<'st>>) -> Self::Output

Performs the + operation. Read more
Source§

impl<'st, const M: usize, R> Add<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: R) -> Self::Output

Performs the + operation. Read more
Source§

impl<'st, R> Add<R> for Const<'st, Int<'st>>
where R: IntoWithStorage<'st, Int<'st>>,

Source§

type Output = Int<'st>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: R) -> Self::Output

Performs the + operation. Read more
Source§

impl<'st, R> Add<R> for Const<'st, Real<'st>>
where R: IntoWithStorage<'st, Real<'st>>,

Source§

type Output = Real<'st>

The resulting type after applying the + operator.
Source§

fn add(self, rhs: R) -> Self::Output

Performs the + operation. Read more
Source§

impl<'st> BitAnd<Const<'st, Bool<'st>>> for bool

Source§

type Output = Bool<'st>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: Const<'st, Bool<'st>>) -> Self::Output

Performs the & operation. Read more
Source§

impl<'st, R> BitAnd<R> for Const<'st, Bool<'st>>
where R: IntoWithStorage<'st, Bool<'st>>,

Source§

type Output = Bool<'st>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: R) -> Self::Output

Performs the & operation. Read more
Source§

impl<'st, const M: usize, R> BitAnd<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the & operator.
Source§

fn bitand(self, rhs: R) -> Self::Output

Performs the & operation. Read more
Source§

impl<'st> BitOr<Const<'st, Bool<'st>>> for bool

Source§

type Output = Bool<'st>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: Const<'st, Bool<'st>>) -> Self::Output

Performs the | operation. Read more
Source§

impl<'st, R> BitOr<R> for Const<'st, Bool<'st>>
where R: IntoWithStorage<'st, Bool<'st>>,

Source§

type Output = Bool<'st>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: R) -> Self::Output

Performs the | operation. Read more
Source§

impl<'st, const M: usize, R> BitOr<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the | operator.
Source§

fn bitor(self, rhs: R) -> Self::Output

Performs the | operation. Read more
Source§

impl<'st> BitXor<Const<'st, Bool<'st>>> for bool

Source§

type Output = Bool<'st>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: Const<'st, Bool<'st>>) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<'st, R> BitXor<R> for Const<'st, Bool<'st>>
where R: IntoWithStorage<'st, Bool<'st>>,

Source§

type Output = Bool<'st>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: R) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<'st, const M: usize, R> BitXor<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the ^ operator.
Source§

fn bitxor(self, rhs: R) -> Self::Output

Performs the ^ operation. Read more
Source§

impl<'st, T: Clone> Clone for Const<'st, T>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'st, T: Copy> Copy for Const<'st, T>

Source§

impl<'st, T: Debug> Debug for Const<'st, T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T> Deref for Const<'_, T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl<'st> Div<Const<'st, Int<'st>>> for i64

Source§

type Output = Int<'st>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Const<'st, Int<'st>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<'st> Div<Const<'st, Real<'st>>> for f64

Source§

type Output = Real<'st>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: Const<'st, Real<'st>>) -> Self::Output

Performs the / operation. Read more
Source§

impl<'st, const M: usize, R> Div<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: R) -> Self::Output

Performs the / operation. Read more
Source§

impl<'st, R> Div<R> for Const<'st, Int<'st>>
where R: IntoWithStorage<'st, Int<'st>>,

Source§

type Output = Int<'st>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: R) -> Self::Output

Performs the / operation. Read more
Source§

impl<'st, R> Div<R> for Const<'st, Real<'st>>
where R: IntoWithStorage<'st, Real<'st>>,

Source§

type Output = Real<'st>

The resulting type after applying the / operator.
Source§

fn div(self, rhs: R) -> Self::Output

Performs the / operation. Read more
Source§

impl<'st, const M: usize> From<Const<'st, BitVec<'st, M>>> for BitVec<'st, M>

Source§

fn from(c: Const<'st, BitVec<'st, M>>) -> Self

Converts to this type from the input type.
Source§

impl<'st> From<Const<'st, Bool<'st>>> for Bool<'st>

Source§

fn from(c: Const<'st, Bool<'st>>) -> Self

Converts to this type from the input type.
Source§

impl<'st, const EB: usize, const SB: usize> From<Const<'st, FloatingPoint<'st, EB, SB>>> for FloatingPoint<'st, EB, SB>

Source§

fn from(c: Const<'st, FloatingPoint<'st, EB, SB>>) -> Self

Converts to this type from the input type.
Source§

impl<'st> From<Const<'st, Int<'st>>> for Int<'st>

Source§

fn from(c: Const<'st, Int<'st>>) -> Self

Converts to this type from the input type.
Source§

impl<'st> From<Const<'st, Real<'st>>> for Real<'st>

Source§

fn from(c: Const<'st, Real<'st>>) -> Self

Converts to this type from the input type.
Source§

impl<'st> From<Const<'st, RoundingMode<'st>>> for RoundingMode<'st>

Source§

fn from(c: Const<'st, RoundingMode<'st>>) -> Self

Converts to this type from the input type.
Source§

impl<'st, T: Into<STerm<'st>>> From<Const<'st, T>> for STerm<'st>

Source§

fn from(c: Const<'st, T>) -> Self

Converts to this type from the input type.
Source§

impl<'st, T> From<Const<'st, T>> for Dynamic<'st>
where T: Into<Dynamic<'st>>,

Source§

fn from(c: Const<'st, T>) -> Self

Converts to this type from the input type.
Source§

impl<'st, X: Sorted<'st>, Y: Sorted<'st>> IntoWithStorage<'st, Array<'st, X, Y>> for Const<'st, Array<'st, X, Y>>

Source§

fn into_with_storage(self, _st: &'st Storage) -> Array<'st, X, Y>

Construct a STerm with the presence of Storage
Source§

impl<'st> IntoWithStorage<'st, Bool<'st>> for Const<'st, Bool<'st>>

Source§

fn into_with_storage(self, _st: &'st Storage) -> Bool<'st>

Construct a STerm with the presence of Storage
Source§

impl<'st> IntoWithStorage<'st, Int<'st>> for Const<'st, Int<'st>>

Source§

fn into_with_storage(self, _st: &'st Storage) -> Int<'st>

Construct a STerm with the presence of Storage
Source§

impl<'st> IntoWithStorage<'st, Real<'st>> for Const<'st, Real<'st>>

Source§

fn into_with_storage(self, _st: &'st Storage) -> Real<'st>

Construct a STerm with the presence of Storage
Source§

impl<'st> Mul<Const<'st, Int<'st>>> for i64

Source§

type Output = Int<'st>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Const<'st, Int<'st>>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'st> Mul<Const<'st, Real<'st>>> for f64

Source§

type Output = Real<'st>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: Const<'st, Real<'st>>) -> Self::Output

Performs the * operation. Read more
Source§

impl<'st, const M: usize, R> Mul<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Self::Output

Performs the * operation. Read more
Source§

impl<'st, R> Mul<R> for Const<'st, Int<'st>>
where R: IntoWithStorage<'st, Int<'st>>,

Source§

type Output = Int<'st>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Self::Output

Performs the * operation. Read more
Source§

impl<'st, R> Mul<R> for Const<'st, Real<'st>>
where R: IntoWithStorage<'st, Real<'st>>,

Source§

type Output = Real<'st>

The resulting type after applying the * operator.
Source§

fn mul(self, rhs: R) -> Self::Output

Performs the * operation. Read more
Source§

impl<'st, A> QuantifierVars<'st> for Const<'st, A>
where A: StaticSorted<'st>,

Source§

fn into_vars(self, _st: &'st Storage) -> &'st [SortedVar<'st>]

The concrete sequence of variable declaration which should be quantified over.
Source§

impl<'st> Rem<Const<'st, Int<'st>>> for i64

Source§

type Output = Int<'st>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: Const<'st, Int<'st>>) -> Self::Output

Performs the % operation. Read more
Source§

impl<'st, const M: usize, R> Rem<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: R) -> Self::Output

Performs the % operation. Read more
Source§

impl<'st, R> Rem<R> for Const<'st, Int<'st>>
where R: IntoWithStorage<'st, Int<'st>>,

Source§

type Output = Int<'st>

The resulting type after applying the % operator.
Source§

fn rem(self, rhs: R) -> Self::Output

Performs the % operation. Read more
Source§

impl<'st> Shl<Const<'st, Int<'st>>> for i64

Source§

type Output = Int<'st>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: Const<'st, Int<'st>>) -> Self::Output

Performs the << operation. Read more
Source§

impl<'st, const M: usize, R> Shl<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: R) -> Self::Output

Performs the << operation. Read more
Source§

impl<'st, R> Shl<R> for Const<'st, Int<'st>>
where R: IntoWithStorage<'st, Int<'st>>,

Source§

type Output = Int<'st>

The resulting type after applying the << operator.
Source§

fn shl(self, rhs: R) -> Self::Output

Performs the << operation. Read more
Source§

impl<'st> Shr<Const<'st, Int<'st>>> for i64

Source§

type Output = Int<'st>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: Const<'st, Int<'st>>) -> Self::Output

Performs the >> operation. Read more
Source§

impl<'st, const M: usize, R> Shr<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: R) -> Self::Output

Performs the >> operation. Read more
Source§

impl<'st, R> Shr<R> for Const<'st, Int<'st>>
where R: IntoWithStorage<'st, Int<'st>>,

Source§

type Output = Int<'st>

The resulting type after applying the >> operator.
Source§

fn shr(self, rhs: R) -> Self::Output

Performs the >> operation. Read more
Source§

impl<'st, T: Sorted<'st>> Sorted<'st> for Const<'st, T>

Source§

type Inner = T

The inner type of the term. This is used for Const<'st, T> where the inner type is T.
Source§

fn sort(&self) -> Sort<'st>

The sort of the term.
Source§

fn is_sort(sort: Sort<'st>) -> bool

Check if a sort is of this type.
Source§

fn st(&self) -> &'st Storage

The storage associated with any term of this sort.
Source§

fn sterm(self) -> STerm<'st>

Constructy the smtlib AST representation of the term with associated storage.
Source§

fn term(self) -> &'st Term<'st>

Construct the smtlib AST representation of term.
Source§

fn into_dynamic(self) -> Dynamic<'st>

Casts the term into a dynamic term which looses static types and stores the sort dynamically.
Source§

fn _eq(self, other: impl IntoWithStorage<'st, Self::Inner>) -> Bool<'st>

Construct the term representing (= self other)
Source§

fn _neq(self, other: impl IntoWithStorage<'st, Self::Inner>) -> Bool<'st>

Construct the term representing (distinct self other)
Source§

fn labeled(self) -> (Label<Self>, Self::Inner)
where Self::Inner: From<STerm<'st>>,

Wraps the term in a a label, which can be used to extract information from models at a later point.
Source§

impl<'st> Sub<Const<'st, Int<'st>>> for i64

Source§

type Output = Int<'st>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Const<'st, Int<'st>>) -> Self::Output

Performs the - operation. Read more
Source§

impl<'st> Sub<Const<'st, Real<'st>>> for f64

Source§

type Output = Real<'st>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: Const<'st, Real<'st>>) -> Self::Output

Performs the - operation. Read more
Source§

impl<'st, const M: usize, R> Sub<R> for Const<'st, BitVec<'st, M>>
where R: Into<BitVec<'st, M>>,

Source§

type Output = BitVec<'st, M>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: R) -> Self::Output

Performs the - operation. Read more
Source§

impl<'st, R> Sub<R> for Const<'st, Int<'st>>
where R: IntoWithStorage<'st, Int<'st>>,

Source§

type Output = Int<'st>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: R) -> Self::Output

Performs the - operation. Read more
Source§

impl<'st, R> Sub<R> for Const<'st, Real<'st>>
where R: IntoWithStorage<'st, Real<'st>>,

Source§

type Output = Real<'st>

The resulting type after applying the - operator.
Source§

fn sub(self, rhs: R) -> Self::Output

Performs the - operation. Read more

Auto Trait Implementations§

§

impl<'st, T> Freeze for Const<'st, T>
where T: Freeze,

§

impl<'st, T> RefUnwindSafe for Const<'st, T>
where T: RefUnwindSafe,

§

impl<'st, T> Send for Const<'st, T>
where T: Send,

§

impl<'st, T> Sync for Const<'st, T>
where T: Sync,

§

impl<'st, T> Unpin for Const<'st, T>
where T: Unpin,

§

impl<'st, T> UnsafeUnpin for Const<'st, T>
where T: UnsafeUnpin,

§

impl<'st, T> UnwindSafe for Const<'st, T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<'st, T> IntoWithStorage<'st, T> for T

Source§

fn into_with_storage(self, _st: &'st Storage) -> T

Construct a STerm with the presence of Storage
Source§

impl<D> OwoColorize for D

Source§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>
where C: Color,

Set the foreground color generically Read more
Source§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>
where C: Color,

Set the background color generically. Read more
Source§

fn black(&self) -> FgColorDisplay<'_, Black, Self>

Change the foreground color to black
Source§

fn on_black(&self) -> BgColorDisplay<'_, Black, Self>

Change the background color to black
Source§

fn red(&self) -> FgColorDisplay<'_, Red, Self>

Change the foreground color to red
Source§

fn on_red(&self) -> BgColorDisplay<'_, Red, Self>

Change the background color to red
Source§

fn green(&self) -> FgColorDisplay<'_, Green, Self>

Change the foreground color to green
Source§

fn on_green(&self) -> BgColorDisplay<'_, Green, Self>

Change the background color to green
Source§

fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>

Change the foreground color to yellow
Source§

fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>

Change the background color to yellow
Source§

fn blue(&self) -> FgColorDisplay<'_, Blue, Self>

Change the foreground color to blue
Source§

fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>

Change the background color to blue
Source§

fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to magenta
Source§

fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to magenta
Source§

fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>

Change the foreground color to purple
Source§

fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>

Change the background color to purple
Source§

fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>

Change the foreground color to cyan
Source§

fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>

Change the background color to cyan
Source§

fn white(&self) -> FgColorDisplay<'_, White, Self>

Change the foreground color to white
Source§

fn on_white(&self) -> BgColorDisplay<'_, White, Self>

Change the background color to white
Source§

fn default_color(&self) -> FgColorDisplay<'_, Default, Self>

Change the foreground color to the terminal default
Source§

fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>

Change the background color to the terminal default
Source§

fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>

Change the foreground color to bright black
Source§

fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>

Change the background color to bright black
Source§

fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>

Change the foreground color to bright red
Source§

fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>

Change the background color to bright red
Source§

fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>

Change the foreground color to bright green
Source§

fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>

Change the background color to bright green
Source§

fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>

Change the foreground color to bright yellow
Source§

fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>

Change the background color to bright yellow
Source§

fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>

Change the foreground color to bright blue
Source§

fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>

Change the background color to bright blue
Source§

fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright magenta
Source§

fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright magenta
Source§

fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>

Change the foreground color to bright purple
Source§

fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>

Change the background color to bright purple
Source§

fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>

Change the foreground color to bright cyan
Source§

fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>

Change the background color to bright cyan
Source§

fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>

Change the foreground color to bright white
Source§

fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>

Change the background color to bright white
Source§

fn bold(&self) -> BoldDisplay<'_, Self>

Make the text bold
Source§

fn dimmed(&self) -> DimDisplay<'_, Self>

Make the text dim
Source§

fn italic(&self) -> ItalicDisplay<'_, Self>

Make the text italicized
Source§

fn underline(&self) -> UnderlineDisplay<'_, Self>

Make the text underlined
Make the text blink
Make the text blink (but fast!)
Source§

fn reversed(&self) -> ReversedDisplay<'_, Self>

Swap the foreground and background colors
Source§

fn hidden(&self) -> HiddenDisplay<'_, Self>

Hide the text
Source§

fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>

Cross out the text
Source§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at compile-time. If the color is constant, use either OwoColorize::fg or a color-specific method, such as OwoColorize::green, Read more
Source§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>
where Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at compile-time. If the color is constant, use either OwoColorize::bg or a color-specific method, such as OwoColorize::on_yellow, Read more
Source§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
Source§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( &self, ) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
Source§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
Source§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
Source§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
Source§

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Source for T
where T: Deref, <T as Deref>::Target: Source,

Source§

type Slice<'a> = <<T as Deref>::Target as Source>::Slice<'a> where T: 'a

A type this Source can be sliced into.
Source§

fn len(&self) -> usize

Length of the source
Source§

fn read<'a, Chunk>(&'a self, offset: usize) -> Option<Chunk>
where Chunk: Chunk<'a>,

Read a chunk of bytes into an array. Returns None when reading out of bounds would occur. Read more
Source§

fn slice(&self, range: Range<usize>) -> Option<<T as Source>::Slice<'_>>

Get a slice of the source at given range. This is analogous to slice::get(range). Read more
Source§

unsafe fn slice_unchecked( &self, range: Range<usize>, ) -> <T as Source>::Slice<'_>

Get a slice of the source at given range. This is analogous to slice::get_unchecked(range). Read more
Source§

fn is_boundary(&self, index: usize) -> bool

Check if index is valid for this Source, that is: Read more
Source§

fn find_boundary(&self, index: usize) -> usize

For &str sources attempts to find the closest char boundary at which source can be sliced, starting from index. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.