acir::circuit::opcodes

Enum BlackBoxFuncCall

Source
pub enum BlackBoxFuncCall<F> {
Show 20 variants AES128Encrypt { inputs: Vec<FunctionInput<F>>, iv: Box<[FunctionInput<F>; 16]>, key: Box<[FunctionInput<F>; 16]>, outputs: Vec<Witness>, }, AND { lhs: FunctionInput<F>, rhs: FunctionInput<F>, output: Witness, }, XOR { lhs: FunctionInput<F>, rhs: FunctionInput<F>, output: Witness, }, RANGE { input: FunctionInput<F>, }, Blake2s { inputs: Vec<FunctionInput<F>>, outputs: Box<[Witness; 32]>, }, Blake3 { inputs: Vec<FunctionInput<F>>, outputs: Box<[Witness; 32]>, }, EcdsaSecp256k1 { public_key_x: Box<[FunctionInput<F>; 32]>, public_key_y: Box<[FunctionInput<F>; 32]>, signature: Box<[FunctionInput<F>; 64]>, hashed_message: Box<[FunctionInput<F>; 32]>, output: Witness, }, EcdsaSecp256r1 { public_key_x: Box<[FunctionInput<F>; 32]>, public_key_y: Box<[FunctionInput<F>; 32]>, signature: Box<[FunctionInput<F>; 64]>, hashed_message: Box<[FunctionInput<F>; 32]>, output: Witness, }, MultiScalarMul { points: Vec<FunctionInput<F>>, scalars: Vec<FunctionInput<F>>, outputs: (Witness, Witness, Witness), }, EmbeddedCurveAdd { input1: Box<[FunctionInput<F>; 3]>, input2: Box<[FunctionInput<F>; 3]>, outputs: (Witness, Witness, Witness), }, Keccakf1600 { inputs: Box<[FunctionInput<F>; 25]>, outputs: Box<[Witness; 25]>, }, RecursiveAggregation { verification_key: Vec<FunctionInput<F>>, proof: Vec<FunctionInput<F>>, public_inputs: Vec<FunctionInput<F>>, key_hash: FunctionInput<F>, proof_type: u32, }, BigIntAdd { lhs: u32, rhs: u32, output: u32, }, BigIntSub { lhs: u32, rhs: u32, output: u32, }, BigIntMul { lhs: u32, rhs: u32, output: u32, }, BigIntDiv { lhs: u32, rhs: u32, output: u32, }, BigIntFromLeBytes { inputs: Vec<FunctionInput<F>>, modulus: Vec<u8>, output: u32, }, BigIntToLeBytes { input: u32, outputs: Vec<Witness>, }, Poseidon2Permutation { inputs: Vec<FunctionInput<F>>, outputs: Vec<Witness>, len: u32, }, Sha256Compression { inputs: Box<[FunctionInput<F>; 16]>, hash_values: Box<[FunctionInput<F>; 8]>, outputs: Box<[Witness; 8]>, },
}
Expand description

These opcodes represent a specialized computation. Even if any computation can be done using only assert-zero opcodes, it is not always efficient. Some proving systems, can implement several computations more efficiently using techniques such as custom gates and lookup tables.

Variants§

§

AES128Encrypt

Ciphers (encrypts) the provided plaintext using AES128 in CBC mode, padding the input using PKCS#7.

  • inputs: byte array [u8; N]
  • iv: initialization vector [u8; 16]
  • key: user key [u8; 16]
  • outputs: byte vector [u8] of length input.len() + (16 - input.len() % 16)

Fields

§inputs: Vec<FunctionInput<F>>
§key: Box<[FunctionInput<F>; 16]>
§outputs: Vec<Witness>
§

AND

Performs the bitwise AND of lhs and rhs. bit_size must be the same for both inputs.

  • lhs: (witness, bit_size)
  • rhs: (witness, bit_size)
  • output: a witness whose value is constrained to be lhs AND rhs, as bit_size bit integers

Fields

§output: Witness
§

XOR

Performs the bitwise XOR of lhs and rhs. bit_size must be the same for both inputs.

  • lhs: (witness, bit_size)
  • rhs: (witness, bit_size)
  • output: a witness whose value is constrained to be lhs XOR rhs, as bit_size bit integers

Fields

§output: Witness
§

RANGE

Range constraint to ensure that a witness can be represented in the specified number of bits.

  • input: (witness, bit_size)

Fields

§input: FunctionInput<F>
§

Blake2s

Computes the Blake2s hash of the inputs, as specified in https://tools.ietf.org/html/rfc7693

  • inputs are a byte array, i.e a vector of (witness, 8)
  • output is a byte array of length 32, i.e. an array of 32 (witness, 8), constrained to be the blake2s of the inputs.

Fields

§inputs: Vec<FunctionInput<F>>
§outputs: Box<[Witness; 32]>
§

Blake3

Computes the Blake3 hash of the inputs

  • inputs are a byte array, i.e a vector of (witness, 8)
  • output is a byte array of length 32, i.e an array of 32 (witness, 8), constrained to be the blake3 of the inputs.

Fields

§inputs: Vec<FunctionInput<F>>
§outputs: Box<[Witness; 32]>
§

EcdsaSecp256k1

Verifies a ECDSA signature over the secp256k1 curve.

  • inputs:
    • x coordinate of public key as 32 bytes
    • y coordinate of public key as 32 bytes
    • the signature, as a 64 bytes array The signature internally will be represented as (r, s), where r and s are fixed-sized big endian scalar values. As the secp256k1 has a 256-bit modulus, we have a 64 byte signature while r and s will both be 32 bytes. We expect s to be normalized. This means given the curve’s order, s should be less than or equal to order / 2. This is done to prevent malleability. For more context regarding malleability you can reference BIP 0062.
    • the hash of the message, as a vector of bytes
  • output: 0 for failure and 1 for success

Expected backend behavior:

  • The backend MAY fail to prove this opcode if the public key is not on the secp256k1 curve.
    • Otherwise the backend MUST constrain the output to be false.
  • The backend MUST constrain the output to be false if s is not normalized.
  • The backend MUST constrain the output to match the signature’s validity.

Fields

§public_key_x: Box<[FunctionInput<F>; 32]>
§public_key_y: Box<[FunctionInput<F>; 32]>
§signature: Box<[FunctionInput<F>; 64]>
§hashed_message: Box<[FunctionInput<F>; 32]>
§output: Witness
§

EcdsaSecp256r1

Verifies a ECDSA signature over the secp256r1 curve.

Same as EcdsaSecp256k1, but done over another curve.

Fields

§public_key_x: Box<[FunctionInput<F>; 32]>
§public_key_y: Box<[FunctionInput<F>; 32]>
§signature: Box<[FunctionInput<F>; 64]>
§hashed_message: Box<[FunctionInput<F>; 32]>
§output: Witness
§

MultiScalarMul

Multiple scalar multiplication (MSM) with a variable base/input point (P) of the embedded curve. An MSM multiplies the points and scalars and sums the results.

  • input:
    • points (witness, N) a vector of x and y coordinates of input
    • points [x1, y1, x2, y2,...].
    • scalars (witness, N) a vector of low and high limbs of input
    • scalars [s1_low, s1_high, s2_low, s2_high, ...]. (witness, N) For Barretenberg, they must both be less than 128 bits.
  • output:
    • a tuple of x and y coordinates of output points computed as s_low*P+s_high*2^{128}*P

Because the Grumpkin scalar field is bigger than the ACIR field, we provide 2 ACIR fields representing the low and high parts of the Grumpkin scalar $a$: a=low+high*2^{128}, with low, high < 2^{128}

Fields

§points: Vec<FunctionInput<F>>
§scalars: Vec<FunctionInput<F>>
§

EmbeddedCurveAdd

Addition over the embedded curve on which the witness is defined The opcode makes the following assumptions but does not enforce them because it is more efficient to do it only when required. For instance, adding two points that are on the curve it guarantee to give a point on the curve.

It assumes that the points are on the curve. If the inputs are the same witnesses index, it will perform a doubling, If not, it assumes that the points’ x-coordinates are not equal. It also assumes neither point is the infinity point.

Fields

§input1: Box<[FunctionInput<F>; 3]>
§input2: Box<[FunctionInput<F>; 3]>
§

Keccakf1600

Keccak Permutation function of width 1600

  • inputs: An array of 25 64-bit Keccak lanes that represent a keccak sponge of 1600 bits
  • outputs: The result of a keccak f1600 permutation on the input state. Also an array of 25 Keccak lanes.

Fields

§inputs: Box<[FunctionInput<F>; 25]>
§outputs: Box<[Witness; 25]>
§

RecursiveAggregation

Computes a recursive aggregation object when verifying a proof inside another circuit. The outputted aggregation object will then be either checked in a top-level verifier or aggregated upon again. The aggregation object should be maintained by the backend implementer.

This opcode prepares the verification of the final proof. In order to fully verify a recursive proof, some operations may still be required to be done by the final verifier (e.g. a pairing check). This is why this black box function does not say if verification is passing or not. It delays the expensive part of verification out of the SNARK and leaves it to the final verifier outside of the SNARK circuit.

This opcode also verifies that the key_hash is indeed a hash of verification_key, allowing the user to use the verification key as private inputs and only have the key_hash as public input, which is more performant.

Warning: the key hash logic does not need to be part of the black box and subject to be removed.

If one of the recursive proofs you verify with the black box function fails to verify, then the verification of the final proof of the main ACIR program will ultimately fail.

Fields

§verification_key: Vec<FunctionInput<F>>

Verification key of the circuit being verified

§proof: Vec<FunctionInput<F>>
§public_inputs: Vec<FunctionInput<F>>

These represent the public inputs of the proof we are verifying They should be checked against in the circuit after construction of a new aggregation state

§key_hash: FunctionInput<F>

A key hash is used to check the validity of the verification key. The circuit implementing this opcode can use this hash to ensure that the key provided to the circuit matches the key produced by the circuit creator

§proof_type: u32

Backend-specific proof type constant. The proof field is agnostic and can come from witness inputs. However, a backend may have many different verifiers which affect the circuit construction. In order for a backend to construct the correct recursive verifier it expects the user to specify a proof type.

§

BigIntAdd

BigInt addition

Fields

§lhs: u32
§rhs: u32
§output: u32
§

BigIntSub

BigInt subtraction

Fields

§lhs: u32
§rhs: u32
§output: u32
§

BigIntMul

BigInt multiplication

Fields

§lhs: u32
§rhs: u32
§output: u32
§

BigIntDiv

BigInt division

Fields

§lhs: u32
§rhs: u32
§output: u32
§

BigIntFromLeBytes

BigInt from le bytes

Fields

§inputs: Vec<FunctionInput<F>>
§modulus: Vec<u8>
§output: u32
§

BigIntToLeBytes

BigInt to le bytes

Fields

§input: u32
§outputs: Vec<Witness>
§

Poseidon2Permutation

Applies the Poseidon2 permutation function to the given state, outputting the permuted state.

Fields

§inputs: Vec<FunctionInput<F>>

Input state for the permutation of Poseidon2

§outputs: Vec<Witness>

Permuted state

§len: u32

State length (in number of field elements) It is the length of inputs and outputs vectors

§

Sha256Compression

Applies the SHA-256 compression function to the input message

§Arguments

  • inputs - input message block
  • hash_values - state from the previous compression
  • outputs - result of the input compressed into 256 bits

Fields

§inputs: Box<[FunctionInput<F>; 16]>

512 bits of the input message, represented by 16 u32s

§hash_values: Box<[FunctionInput<F>; 8]>

Vector of 8 u32s used to compress the input

§outputs: Box<[Witness; 8]>

Output of the compression, represented by 8 u32s

Implementations§

Trait Implementations§

Source§

impl<F: Clone> Clone for BlackBoxFuncCall<F>

Source§

fn clone(&self) -> BlackBoxFuncCall<F>

Returns a copy of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl<F: Display + Copy> Debug for BlackBoxFuncCall<F>

Source§

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

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

impl<'de, F> Deserialize<'de> for BlackBoxFuncCall<F>
where F: Deserialize<'de>,

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<F: Display + Copy> Display for BlackBoxFuncCall<F>

Source§

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

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

impl<F: Hash> Hash for BlackBoxFuncCall<F>

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<F: PartialEq> PartialEq for BlackBoxFuncCall<F>

Source§

fn eq(&self, other: &BlackBoxFuncCall<F>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<F> ProtoCodec<BlackBoxFuncCall<F>, BlackBoxFuncCall> for ProtoSchema<F>
where F: AcirField,

Source§

fn encode(value: &BlackBoxFuncCall<F>) -> BlackBoxFuncCall

Convert domain type T to protobuf representation R.
Source§

fn decode(value: &BlackBoxFuncCall) -> Result<BlackBoxFuncCall<F>>

Try to convert protobuf representation R to domain type T.
Source§

fn encode_some(value: &T) -> Option<R>

Encode a field as Some.
Source§

fn encode_vec<'a, I>(values: I) -> Vec<R>
where I: IntoIterator<Item = &'a T>, T: 'a,

Encode multiple values as a vector.
Source§

fn decode_wrap(value: &R, msg: &'static str) -> Result<T, Report>

Decode a field and attach the name of the field if it fails.
Source§

fn decode_vec(values: &[R]) -> Result<Vec<T>, Report>

Decode multiple values into a vector.
Source§

fn decode_vec_wrap(values: &[R], msg: &'static str) -> Result<Vec<T>, Report>

Decode multiple values into a vector, attaching a field name to any errors.
Source§

fn decode_arr<const N: usize>(values: &[R]) -> Result<[T; N], Report>

Decode a fixed size array.
Source§

fn decode_arr_wrap<const N: usize>( values: &[R], msg: &'static str, ) -> Result<[T; N], Report>

Decode a fixed size array, attaching a field name to any errors
Source§

fn decode_box_arr<const N: usize>(values: &[R]) -> Result<Box<[T; N]>, Report>

Decode a boxed fixed size array.
Source§

fn decode_box_arr_wrap<const N: usize>( values: &[R], msg: &'static str, ) -> Result<Box<[T; N]>, Report>

Decode a boxed fixed size array, attaching a field name to any errors
Source§

fn decode_some(value: &Option<R>) -> Result<T, Report>

Decode an optional field as a required one; fails if it’s None.
Source§

fn decode_some_wrap(value: &Option<R>, msg: &'static str) -> Result<T, Report>

Decode an optional field as a required one, attaching a field name to any errors. Returns error if the field is missing.
Source§

fn decode_opt_wrap( value: &Option<R>, msg: &'static str, ) -> Result<Option<T>, Report>

Decode an optional field, attaching a field name to any errors. Return None if the field is missing.
Source§

fn serialize_to_vec(value: &T) -> Vec<u8>
where R: Message,

Encode a domain type to protobuf and serialize it to bytes.
Source§

fn deserialize_from_slice(buf: &[u8]) -> Result<T, Report>
where R: Message + Default,

Deserialize a buffer into protobuf and then decode into the domain type.
Source§

impl<F> Serialize for BlackBoxFuncCall<F>
where F: Serialize,

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<F: Eq> Eq for BlackBoxFuncCall<F>

Source§

impl<F> StructuralPartialEq for BlackBoxFuncCall<F>

Auto Trait Implementations§

§

impl<F> Freeze for BlackBoxFuncCall<F>
where F: Freeze,

§

impl<F> RefUnwindSafe for BlackBoxFuncCall<F>
where F: RefUnwindSafe,

§

impl<F> Send for BlackBoxFuncCall<F>
where F: Send,

§

impl<F> Sync for BlackBoxFuncCall<F>
where F: Sync,

§

impl<F> Unpin for BlackBoxFuncCall<F>
where F: Unpin,

§

impl<F> UnwindSafe for BlackBoxFuncCall<F>
where F: 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, dst: *mut u8)

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

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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
§

impl<D> OwoColorize for D

§

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

Set the foreground color generically Read more
§

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

Set the background color generically. Read more
§

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

Change the foreground color to black
§

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

Change the background color to black
§

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

Change the foreground color to red
§

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

Change the background color to red
§

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

Change the foreground color to green
§

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

Change the background color to green
§

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

Change the foreground color to yellow
§

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

Change the background color to yellow
§

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

Change the foreground color to blue
§

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

Change the background color to blue
§

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

Change the foreground color to magenta
§

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

Change the background color to magenta
§

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

Change the foreground color to purple
§

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

Change the background color to purple
§

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

Change the foreground color to cyan
§

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

Change the background color to cyan
§

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

Change the foreground color to white
§

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

Change the background color to white
§

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

Change the foreground color to the terminal default
§

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

Change the background color to the terminal default
§

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

Change the foreground color to bright black
§

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

Change the background color to bright black
§

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

Change the foreground color to bright red
§

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

Change the background color to bright red
§

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

Change the foreground color to bright green
§

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

Change the background color to bright green
§

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

Change the foreground color to bright yellow
§

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

Change the background color to bright yellow
§

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

Change the foreground color to bright blue
§

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

Change the background color to bright blue
§

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

Change the foreground color to bright magenta
§

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

Change the background color to bright magenta
§

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

Change the foreground color to bright purple
§

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

Change the background color to bright purple
§

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

Change the foreground color to bright cyan
§

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

Change the background color to bright cyan
§

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

Change the foreground color to bright white
§

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

Change the background color to bright white
§

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

Make the text bold
§

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

Make the text dim
§

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

Make the text italicized
§

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

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

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

Swap the foreground and background colors
§

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

Hide the text
§

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

Cross out the text
§

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
§

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
§

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.
§

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.
§

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

Sets the foreground color to an RGB value.
§

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

Sets the background color to an RGB value.
§

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

Apply a runtime-determined style
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> SectionExt for T
where T: Display + Send + Sync + 'static,

Source§

fn header<C>(self, header: C) -> IndentedSection<C, T>
where C: Display + Send + Sync + 'static,

Add a header to a Section and indent the body 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,