Skip to main content

ZkStdLib

Struct ZkStdLib 

Source
pub struct ZkStdLib { /* private fields */ }
Expand description

The ZkStdLib exposes all tools that are used in circuit generation.

Implementations§

Source§

impl ZkStdLib

Source

pub fn new(config: &ZkStdLibConfig, max_bit_len: usize) -> Self

Creates a new ZkStdLib given its config.

Source

pub fn configure( meta: &mut ConstraintSystem<Fq>, (arch, max_bit_len): (ZkStdLibArch, u8), ) -> ZkStdLibConfig

Configure ZkStdLib from scratch.

Source§

impl ZkStdLib

Source

pub fn jubjub(&self) -> &EccChip<JubjubExtended>

Native EccChip.

Source

pub fn biguint( &self, ) -> &BigUintGadget<Fq, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>

Gadget for performing in-circuit big-unsigned integer operations.

Source

pub fn map_gadget( &self, ) -> &MapGadget<Fq, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>, PoseidonChip<Fq>>

Gadget for performing map and non-map checks

Source

pub fn secp256k1( &self, ) -> &ForeignWeierstrassEccChip<Fq, K256, MultiEmulationParams, FieldChip<Fq, Fq, MultiEmulationParams, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>

Chip for performing in-circuit operations over the Secp256k1 curve, its scalar field or its base field.

Source

pub fn p256( &self, ) -> &ForeignWeierstrassEccChip<Fq, P256, MultiEmulationParams, FieldChip<Fq, Fq, MultiEmulationParams, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>

Chip for performing in-circuit operations over the P256 curve, its scalar field or its base field.

Source

pub fn bls12_381( &self, ) -> &ForeignWeierstrassEccChip<Fq, G1Projective, G1Projective, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>

Chip for performing in-circuit operations over the BLS12-381 curve, its scalar field or its base field.

Source

pub fn curve25519( &self, ) -> &ForeignEdwardsEccChip<Fq, Curve25519, MultiEmulationParams, FieldChip<Fq, Scalar, MultiEmulationParams, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>

Chip for performing in-circuit operations over Curve25519.

Source

pub fn base64(&self) -> &Base64Chip<Fq>

Chip for performing in-circuit base64 decoding.

Source

pub fn parser( &self, ) -> &ParserGadget<Fq, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>

Gadget for column-free parsing helpers (fetch_bytes, date_to_int, etc.). Always available (no arch flag needed).

Source

pub fn scanner(&self) -> &ScannerChip<Fq>

Chip for various scanning functions based on lookups. This includes automaton-based parsing (ScannerChip::parse) and substring checks (ScannerChip::check_subsequence, ScannerChip::check_bytes).

Returns the scanner chip for automaton-based parsing and substring checks. The static automaton table is loaded automatically when parse is called with a Static(..) variant.

Source

pub fn verifier(&self) -> &VerifierGadget<BlstrsEmulation>

Chip for performing in-circuit verification of proofs (generated with Poseidon as the Fiat-Shamir transcript hash).

Source

pub fn assert_true( &self, layouter: &mut impl Layouter<Fq>, input: &AssignedBit<Fq>, ) -> Result<(), Error>

Assert that a given assigned bit is true.

let input: AssignedBit<F> = chip.assign_fixed(layouter, true)?;
chip.assert_true(layouter, &input)?;
Source

pub fn assert_false( &self, layouter: &mut impl Layouter<Fq>, input: &AssignedBit<Fq>, ) -> Result<(), Error>

Assert that a given assigned bit is false

Source

pub fn lower_than( &self, layouter: &mut impl Layouter<Fq>, x: &AssignedNative<Fq>, y: &AssignedNative<Fq>, n: u32, ) -> Result<AssignedBit<Fq>, Error>

Returns 1 iff x < y.

let x: AssignedNative<F> = chip.assign_fixed(layouter, F::from(127))?;
let y: AssignedNative<F> = chip.assign_fixed(layouter, F::from(212))?;
let condition = chip.lower_than(layouter, &x, &y, 8)?;

chip.assert_true(layouter, &condition)?;
§Unsatisfiable Circuit

If x or y are not in the range [0, 2^n).

let x: AssignedNative<F> = chip.assign_fixed(layouter, F::from(127))?;
let y: AssignedNative<F> = chip.assign_fixed(layouter, F::from(212))?;
let _condition = chip.lower_than(layouter, &x, &y, 7)?;

Setting n > (F::NUM_BITS - 1) / 2 will result in a compile-time error.

Source

pub fn poseidon( &self, layouter: &mut impl Layouter<Fq>, input: &[AssignedNative<Fq>], ) -> Result<AssignedNative<Fq>, Error>

Poseidon hash from a slice of native values into a native value.

let x: AssignedNative<F> = chip.assign_fixed(layouter, F::from(127))?;
let y: AssignedNative<F> = chip.assign_fixed(layouter, F::from(212))?;

let _hash = chip.poseidon(layouter, &[x, y])?;
Source

pub fn poseidon_varlen<const M: usize>( &self, layouter: &mut impl Layouter<Fq>, input: &AssignedVector<Fq, AssignedNative<Fq>, M, RATE>, ) -> Result<AssignedNative<Fq>, Error>

Poseidon hash over a payload whose element count can vary between proofs.

Unlike poseidon, which takes a plain slice whose length is structurally fixed in the circuit (the same for every proof), this variant takes an AssignedVector: a specialized structure for carrying data of varying length, up to a maximum capacity of M elements.

M must be a multiple of 2 (the Poseidon absorption rate).

Source

pub fn hash_to_curve( &self, layouter: &mut impl Layouter<Fq>, inputs: &[AssignedNative<Fq>], ) -> Result<AssignedNativePoint<JubjubExtended>, Error>

Hashes a slice of assigned values into (x, y) coordinates which are guaranteed to be in the curve C. For usage, see HashToCurveGadget.

Source

pub fn sha2_256( &self, layouter: &mut impl Layouter<Fq>, input: &[AssignedByte<Fq>], ) -> Result<[AssignedByte<Fq>; 32], Error>

SHA2-256. Takes as input a slice of assigned bytes and returns the assigned input/output in bytes. We assume the field uses little endian encoding.

let input = chip.assign_many(
    layouter,
    &[
        Value::known(13),
        Value::known(226),
        Value::known(119),
        Value::known(5),
    ],
)?;

let _hash = chip.sha2_256(layouter, &input)?;
Source

pub fn sha2_256_varlen<const M: usize>( &self, layouter: &mut impl Layouter<Fq>, input: &AssignedVector<Fq, AssignedByte<Fq>, M, 64>, ) -> Result<[AssignedByte<Fq>; 32], Error>

SHA-256 hash over a payload whose byte count can vary between proofs.

Unlike sha2_256, which takes a plain slice whose length is structurally fixed in the circuit (the same for every proof), this variant takes an AssignedVector: a specialized structure for carrying data of varying length, up to a maximum capacity of M bytes.

M must be a multiple of 64 (the SHA-256 block size).

Source

pub fn sha2_512( &self, layouter: &mut impl Layouter<Fq>, input: &[AssignedByte<Fq>], ) -> Result<[AssignedByte<Fq>; 64], Error>

SHA2-512 hash.

Source

pub fn sha3_256( &self, layouter: &mut impl Layouter<Fq>, input: &[AssignedByte<Fq>], ) -> Result<[AssignedByte<Fq>; 32], Error>

SHA3-256 hash (third-party implementation).

Source

pub fn keccak_256( &self, layouter: &mut impl Layouter<Fq>, input: &[AssignedByte<Fq>], ) -> Result<[AssignedByte<Fq>; 32], Error>

Keccak-256 hash (third-party implementation).

Source

pub fn blake2b_256( &self, layouter: &mut impl Layouter<Fq>, input: &[AssignedByte<Fq>], ) -> Result<[AssignedByte<Fq>; 32], Error>

Blake2b hash with a 256-bit output, unkeyed (third-party implementation).

Source

pub fn blake2b_512( &self, layouter: &mut impl Layouter<Fq>, input: &[AssignedByte<Fq>], ) -> Result<[AssignedByte<Fq>; 64], Error>

Blake2b hash with a 512-bit output, unkeyed (third-party implementation).

Trait Implementations§

Source§

impl ArithInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib

Source§

fn linear_combination( &self, layouter: &mut impl Layouter<Fq>, terms: &[(Fq, AssignedNative<Fq>)], constant: Fq, ) -> Result<AssignedNative<Fq>, Error>

Addition of many elements, given a slice of terms of the form (coeff_i, x_i) and a constant k, returns k + (sum_i coeff_i * x_i). Read more
Source§

fn mul( &self, layouter: &mut impl Layouter<Fq>, x: &AssignedNative<Fq>, y: &AssignedNative<Fq>, multiplying_constant: Option<Fq>, ) -> Result<AssignedNative<Fq>, Error>

Multiplication, possibly with an additional multiplying constant. Read more
Source§

fn div( &self, layouter: &mut impl Layouter<Fq>, x: &AssignedNative<Fq>, y: &AssignedNative<Fq>, ) -> Result<AssignedNative<Fq>, Error>

Division. Division of x by y will make the circuit unsatisfiable if y = 0. Read more
Source§

fn inv( &self, layouter: &mut impl Layouter<Fq>, x: &AssignedNative<Fq>, ) -> Result<AssignedNative<Fq>, Error>

Inversion (multiplicative inverse). The circuit will become unsatisfiable if x = 0. Read more
Source§

fn inv0( &self, layouter: &mut impl Layouter<Fq>, x: &AssignedNative<Fq>, ) -> Result<AssignedNative<Fq>, Error>

Inversion (multiplicative inverse). If x = 0, this function returns 0. Read more
Source§

fn add( &self, layouter: &mut impl Layouter<F>, x: &Assigned, y: &Assigned, ) -> Result<Assigned, Error>

Addition. Read more
Source§

fn sub( &self, layouter: &mut impl Layouter<F>, x: &Assigned, y: &Assigned, ) -> Result<Assigned, Error>

Subtraction. Read more
Source§

fn neg( &self, layouter: &mut impl Layouter<F>, x: &Assigned, ) -> Result<Assigned, Error>

Negation (additive inverse). Read more
Source§

fn add_constant( &self, layouter: &mut impl Layouter<F>, x: &Assigned, constant: <Assigned as InnerValue>::Element, ) -> Result<Assigned, Error>

Addition of a constant. Read more
Source§

fn add_constants( &self, layouter: &mut impl Layouter<F>, xs: &[Assigned], constants: &[<Assigned as InnerValue>::Element], ) -> Result<Vec<Assigned>, Error>

Pair-wise addition of a constant slice to a slice of assigned values. Read more
Source§

fn mul_by_constant( &self, layouter: &mut impl Layouter<F>, x: &Assigned, constant: <Assigned as InnerValue>::Element, ) -> Result<Assigned, Error>

Multiplication by a constant. This function is potentially more efficient than composing assigned_fixed and mul. Read more
Source§

fn square( &self, layouter: &mut impl Layouter<F>, x: &Assigned, ) -> Result<Assigned, Error>

Multiplication of an element by itself.
Source§

fn pow( &self, layouter: &mut impl Layouter<F>, x: &Assigned, n: u64, ) -> Result<Assigned, Error>

Exponentiate the given assigned element to the given (constant) n. pow(zero, 0) is one by definition.
Source§

fn add_and_mul( &self, layouter: &mut impl Layouter<F>, _: (<Assigned as InnerValue>::Element, &Assigned), _: (<Assigned as InnerValue>::Element, &Assigned), _: (<Assigned as InnerValue>::Element, &Assigned), k: <Assigned as InnerValue>::Element, m: <Assigned as InnerValue>::Element, ) -> Result<Assigned, Error>

Computes a*x + b*y + c*z + k + m*x*y.
Source§

impl<T> AssertionInstructions<Fq, T> for ZkStdLib

Source§

fn assert_equal( &self, layouter: &mut impl Layouter<Fq>, x: &T, y: &T, ) -> Result<(), Error>

Ensures that the given assigned elements are the same. Read more
Source§

fn assert_not_equal( &self, layouter: &mut impl Layouter<Fq>, x: &T, y: &T, ) -> Result<(), Error>

Ensures that the given assigned elements are different. Read more
Source§

fn assert_equal_to_fixed( &self, layouter: &mut impl Layouter<Fq>, x: &T, constant: T::Element, ) -> Result<(), Error>

Ensures that the given assigned element is equal to the given constant. Read more
Source§

fn assert_not_equal_to_fixed( &self, layouter: &mut impl Layouter<Fq>, x: &T, constant: T::Element, ) -> Result<(), Error>

Ensures that the given assigned element is different from the given constant. Read more
Source§

impl<T> AssignmentInstructions<Fq, T> for ZkStdLib

Source§

fn assign( &self, layouter: &mut impl Layouter<Fq>, value: Value<T::Element>, ) -> Result<T, Error>

Assigns an element as a private input to the circuit. Read more
Source§

fn assign_fixed( &self, layouter: &mut impl Layouter<Fq>, constant: T::Element, ) -> Result<T, Error>

Assigns a fixed (constant) element. Read more
Source§

fn assign_many( &self, layouter: &mut impl Layouter<Fq>, values: &[Value<T::Element>], ) -> Result<Vec<T>, Error>

Assigns several elements as private inputs to the circuit. Read more
Source§

fn assign_many_fixed( &self, layouter: &mut impl Layouter<F>, values: &[<Assigned as InnerValue>::Element], ) -> Result<Vec<Assigned>, Error>

Assigns several elements fixed values to the circuit. Read more
Source§

impl BinaryInstructions<Fq> for ZkStdLib

Source§

fn and( &self, layouter: &mut impl Layouter<Fq>, bits: &[AssignedBit<Fq>], ) -> Result<AssignedBit<Fq>, Error>

Conjunction of the given assigned bits. Read more
Source§

fn or( &self, layouter: &mut impl Layouter<Fq>, bits: &[AssignedBit<Fq>], ) -> Result<AssignedBit<Fq>, Error>

Disjunction of the given assigned bits. Read more
Source§

fn xor( &self, layouter: &mut impl Layouter<Fq>, bits: &[AssignedBit<Fq>], ) -> Result<AssignedBit<Fq>, Error>

Exclusive-OR of all the given assigned bits. Read more
Source§

fn not( &self, layouter: &mut impl Layouter<Fq>, bit: &AssignedBit<Fq>, ) -> Result<AssignedBit<Fq>, Error>

Negation of the given assigned bit. Read more
Source§

impl BitwiseInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib

Source§

fn band( &self, layouter: &mut impl Layouter<F>, x: &Assigned, y: &Assigned, n: usize, ) -> Result<Assigned, Error>

Bitwise conjunction of the given assigned elements, interpreted as binary bit-strings of length n. Read more
Source§

fn bor( &self, layouter: &mut impl Layouter<F>, x: &Assigned, y: &Assigned, n: usize, ) -> Result<Assigned, Error>

Bitwise disjunction of the given assigned elements, interpreted as binary bit-strings of length n. Read more
Source§

fn bxor( &self, layouter: &mut impl Layouter<F>, x: &Assigned, y: &Assigned, n: usize, ) -> Result<Assigned, Error>

Bitwise exclusive-or of the given assigned elements, interpreted as binary bit-strings of length n. Read more
Source§

fn bnot( &self, layouter: &mut impl Layouter<F>, x: &Assigned, n: usize, ) -> Result<Assigned, Error>

Bitwise negation of the given assigned element, interpreted as a binary bit-string of length n. Read more
Source§

impl CanonicityInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib

Source§

fn le_bits_lower_than( &self, layouter: &mut impl Layouter<Fq>, bits: &[AssignedBit<Fq>], bound: BigUint, ) -> Result<AssignedBit<Fq>, Error>

Returns true iff the integer represented by the given sequence of assigned bits, interpreted in little-endian, is strictly lower than the given bound. Read more
Source§

fn le_bits_geq_than( &self, layouter: &mut impl Layouter<Fq>, bits: &[AssignedBit<Fq>], bound: BigUint, ) -> Result<AssignedBit<Fq>, Error>

Returns true iff the integer represented by the given sequence of assigned bits, interpreted in little-endian, is greater than or equal to the given bound.
Source§

fn is_canonical( &self, layouter: &mut impl Layouter<F>, bits: &[AssignedBit<F>], ) -> Result<AssignedBit<F>, Error>

Returns true iff the given sequence of bits is canonical in the underlying field Assigned::Element. Namely, iff |bits| <= Assigned::Element::NUM_BITS and the integer represented by the given sequence of assigned bits, interpreted in little-endian, is strictly lower than the order of Assigned::Element. Read more
Source§

impl Clone for ZkStdLib

Source§

fn clone(&self) -> ZkStdLib

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<T> CommittedInstanceInstructions<Fq, T> for ZkStdLib

Source§

fn constrain_as_committed_public_input( &self, layouter: &mut impl Layouter<Fq>, assigned: &T, ) -> Result<(), Error>

Constrains the given assigned value as a public input that will be provided in committed form.
Source§

impl<Assigned> ControlFlowInstructions<Fq, Assigned> for ZkStdLib

Source§

fn select( &self, layouter: &mut impl Layouter<Fq>, cond: &AssignedBit<Fq>, x: &Assigned, y: &Assigned, ) -> Result<Assigned, Error>

Returns x if cond = true and y otherwise. Read more
Source§

fn cond_swap( &self, layouter: &mut impl Layouter<Fq>, cond: &AssignedBit<Fq>, x: &Assigned, y: &Assigned, ) -> Result<(Assigned, Assigned), Error>

Swaps two elements x and y only if cond is set to 1.
Source§

fn cond_assert_equal( &self, layouter: &mut impl Layouter<F>, cond: &AssignedBit<F>, x: &Assigned, y: &Assigned, ) -> Result<(), Error>

Equality assertion only if cond is set to 1.
Source§

impl<T1, T2> ConversionInstructions<Fq, T1, T2> for ZkStdLib

Source§

fn convert_value(&self, x: &T1::Element) -> Option<T2::Element>

Converts an AssignedSource::Element into an AssignedTarget::Element, returns None if the conversion failed.
Source§

fn convert(&self, layouter: &mut impl Layouter<Fq>, x: &T1) -> Result<T2, Error>

Converts an AssignedSource into an AssignedTarget. Read more
Source§

impl Debug for ZkStdLib

Source§

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

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

impl DecompositionInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib

Source§

fn assigned_to_le_bits( &self, layouter: &mut impl Layouter<Fq>, x: &AssignedNative<Fq>, nb_bits: Option<usize>, enforce_canonical: bool, ) -> Result<Vec<AssignedBit<Fq>>, Error>

Returns a vector of assigned bits representing the given assigned element in little-endian. Read more
Source§

fn assigned_to_le_bytes( &self, layouter: &mut impl Layouter<Fq>, x: &AssignedNative<Fq>, nb_bytes: Option<usize>, ) -> Result<Vec<AssignedByte<Fq>>, Error>

Returns a vector of assigned bytes representing the given element in little-endian. Read more
Source§

fn assigned_to_le_chunks( &self, layouter: &mut impl Layouter<Fq>, x: &AssignedNative<Fq>, nb_bits_per_chunk: usize, nb_chunks: Option<usize>, ) -> Result<Vec<AssignedNative<Fq>>, Error>

Returns a vector of AssignedNative values representing the given element in little-endian. The output length may be specified, in which case this function will be imposing an upper bound on the value of x. Read more
Source§

fn sgn0( &self, layouter: &mut impl Layouter<Fq>, x: &AssignedNative<Fq>, ) -> Result<AssignedBit<Fq>, Error>

Sign function as described in RFC 9380. sgn0(x) := x mod 2.
Source§

fn assigned_to_be_bits( &self, layouter: &mut impl Layouter<F>, x: &Assigned, nb_bits: Option<usize>, enforce_canonical: bool, ) -> Result<Vec<AssignedBit<F>>, Error>

Same as assigned_to_le_bits but the output bits are given in big-endian.
Source§

fn assigned_to_be_bytes( &self, layouter: &mut impl Layouter<F>, x: &Assigned, nb_bytes: Option<usize>, ) -> Result<Vec<AssignedByte<F>>, Error>

Same as assigned_to_le_bytes but the output bytes are given in big-endian.
Source§

fn assigned_from_le_bits( &self, layouter: &mut impl Layouter<F>, bits: &[AssignedBit<F>], ) -> Result<Assigned, Error>

Returns the element represented by the given vector of assigned bits, by interpreting it as a little-endian bit encoding. Read more
Source§

fn assigned_from_be_bits( &self, layouter: &mut impl Layouter<F>, bits: &[AssignedBit<F>], ) -> Result<Assigned, Error>

Same as assigned_from_le_bits but the output bits are given in big-endian.
Source§

fn assigned_from_le_bytes( &self, layouter: &mut impl Layouter<F>, bytes: &[AssignedByte<F>], ) -> Result<Assigned, Error>

Returns the element represented by the given vector of assigned bytes, by interpreting it in little-endian. Read more
Source§

fn assigned_from_be_bytes( &self, layouter: &mut impl Layouter<F>, bytes: &[AssignedByte<F>], ) -> Result<Assigned, Error>

Same as assigned_from_le_bytes but the output bytes are given in big-endian.
Source§

impl DivisionInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib

Source§

fn div_rem( &self, layouter: &mut impl Layouter<F>, dividend: &Assigned, divisor: BigUint, dividend_bound: Option<BigUint>, ) -> Result<(Assigned, Assigned), Error>

Integer division by a constant. Read more
Source§

fn rem( &self, layouter: &mut impl Layouter<F>, input: &Assigned, modulus: BigUint, input_bound: Option<BigUint>, ) -> Result<Assigned, Error>

Integer modulo operation. Read more
Source§

impl<T> EqualityInstructions<Fq, T> for ZkStdLib

Source§

fn is_equal( &self, layouter: &mut impl Layouter<Fq>, x: &T, y: &T, ) -> Result<AssignedBit<Fq>, Error>

Returns 1 if the elements are equal, returns 0 otherwise. Read more
Source§

fn is_not_equal( &self, layouter: &mut impl Layouter<Fq>, x: &T, y: &T, ) -> Result<AssignedBit<Fq>, Error>

Returns 0 if the elements are equal, returns 1 otherwise.
Source§

fn is_equal_to_fixed( &self, layouter: &mut impl Layouter<Fq>, x: &T, constant: T::Element, ) -> Result<AssignedBit<Fq>, Error>

Returns 1 iff the given element equals the given constant. Read more
Source§

fn is_not_equal_to_fixed( &self, layouter: &mut impl Layouter<Fq>, x: &T, constant: T::Element, ) -> Result<AssignedBit<Fq>, Error>

Returns 1 iff the given element is not equal to the given constant.
Source§

impl FieldInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib

Source§

fn order(&self) -> BigUint

The field order.
Source§

fn assert_qr( &self, layouter: &mut impl Layouter<F>, x: &Assigned, ) -> Result<(), Error>

Assert that the given input is a quadratic residue of the field. This is done by exhibiting a square root.
Source§

fn is_square( &self, layouter: &mut impl Layouter<F>, x: &Assigned, ) -> Result<AssignedBit<F>, Error>

Returns 1 if the given input is a quadratic residue and 0 otherwise.
Source§

impl<T> PublicInputInstructions<Fq, T> for ZkStdLib

Source§

fn as_public_input( &self, layouter: &mut impl Layouter<Fq>, assigned: &T, ) -> Result<Vec<AssignedNative<Fq>>, Error>

Returns the cells associated with the given assigned value with the same format as a public input. This function is the in-circuit analog of Instantiable::as_public_input.
Source§

fn constrain_as_public_input( &self, layouter: &mut impl Layouter<Fq>, assigned: &T, ) -> Result<(), Error>

Constrains the given assigned value as a public input to the circuit. Read more
Source§

fn assign_as_public_input( &self, layouter: &mut impl Layouter<Fq>, value: Value<T::Element>, ) -> Result<T, Error>

Same as assign, but it immediately constrains the assigned value as a public input. This allows the implementer of this function to skip some in-circuit checks on the structure of the assigned value, which will be guaranteed to hold through the public input bind. Read more
Source§

impl RangeCheckInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib

Source§

fn assign_lower_than_fixed( &self, layouter: &mut impl Layouter<Fq>, value: Value<Fq>, bound: &BigUint, ) -> Result<AssignedNative<Fq>, Error>

Assigns an element that is immediately range-checked to be strictly lower than the given bound. This is potentially more efficient than composing [self.assign] with [self.assert_lower_than_fixed]. Read more
Source§

fn assert_lower_than_fixed( &self, layouter: &mut impl Layouter<Fq>, x: &AssignedNative<Fq>, bound: &BigUint, ) -> Result<(), Error>

Asserts that the given assigned element is in the range [0, bound). Read more
Source§

impl<const M: usize, const A: usize, T> VectorInstructions<Fq, T, M, A> for ZkStdLib

Source§

fn trim_beginning( &self, layouter: &mut impl Layouter<Fq>, input: &AssignedVector<Fq, T, M, A>, n_elems: usize, ) -> Result<AssignedVector<Fq, T, M, A>, Error>

Trims n_elems elements from the beginning of the vector. The trimmed elements will not be changed by filler elements, they will remain in the buffer but not as part of the effective payload. Read more
Source§

fn padding_flag( &self, layouter: &mut impl Layouter<Fq>, input: &AssignedVector<Fq, T, M, A>, ) -> Result<(Box<[AssignedBit<Fq>; M]>, VectorBounds<Fq>), Error>

Returns a vector of AssignedBits signaling the cells that represent padding with a 1, and the ones that represent payload data with a 0. Also returns the (start, end) limits of the data in the buffer, since they are computed internally.
Source§

fn get_limits( &self, layouter: &mut impl Layouter<Fq>, input: &AssignedVector<Fq, T, M, A>, ) -> Result<VectorBounds<Fq>, Error>

Returns the first and last positions of data in the buffer.
Source§

fn resize<const L: usize>( &self, layouter: &mut impl Layouter<Fq>, input: AssignedVector<Fq, T, M, A>, ) -> Result<AssignedVector<Fq, T, L, A>, Error>

Changes the size of an AssignedVector from M to L. Read more
Source§

fn assign_with_filler( &self, layouter: &mut impl Layouter<Fq>, value: Value<Vec<T::Element>>, filler: Option<T::Element>, ) -> Result<AssignedVector<Fq, T, M, A>, Error>

Assigns vector with a chosen filler value. Read more
Source§

impl ZeroInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib

Source§

fn assert_zero( &self, layouter: &mut impl Layouter<F>, x: &Assigned, ) -> Result<(), Error>

Enforces that the given assigned element is zero. Read more
Source§

fn assert_non_zero( &self, layouter: &mut impl Layouter<F>, x: &Assigned, ) -> Result<(), Error>

Asserts that the given element is non-zero.
Source§

fn is_zero( &self, layouter: &mut impl Layouter<F>, x: &Assigned, ) -> Result<AssignedBit<F>, Error>

Returns 1 iff the given element equals zero (the additive identity). Read more

Auto Trait Implementations§

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> Conv for T

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

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

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

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

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

Source§

fn fg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the foreground set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like red() and green(), which have the same functionality but are pithier.

§Example

Set foreground color to white using fg():

use yansi::{Paint, Color};

painted.fg(Color::White);

Set foreground color to white using white().

use yansi::Paint;

painted.white();
Source§

fn primary(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Primary].

§Example
println!("{}", value.primary());
Source§

fn fixed(&self, color: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Fixed].

§Example
println!("{}", value.fixed(color));
Source§

fn rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the fg() set to [Color :: Rgb].

§Example
println!("{}", value.rgb(r, g, b));
Source§

fn black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Black].

§Example
println!("{}", value.black());
Source§

fn red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Red].

§Example
println!("{}", value.red());
Source§

fn green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Green].

§Example
println!("{}", value.green());
Source§

fn yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Yellow].

§Example
println!("{}", value.yellow());
Source§

fn blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Blue].

§Example
println!("{}", value.blue());
Source§

fn magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Magenta].

§Example
println!("{}", value.magenta());
Source§

fn cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: Cyan].

§Example
println!("{}", value.cyan());
Source§

fn white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: White].

§Example
println!("{}", value.white());
Source§

fn bright_black(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlack].

§Example
println!("{}", value.bright_black());
Source§

fn bright_red(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightRed].

§Example
println!("{}", value.bright_red());
Source§

fn bright_green(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightGreen].

§Example
println!("{}", value.bright_green());
Source§

fn bright_yellow(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightYellow].

§Example
println!("{}", value.bright_yellow());
Source§

fn bright_blue(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightBlue].

§Example
println!("{}", value.bright_blue());
Source§

fn bright_magenta(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.bright_magenta());
Source§

fn bright_cyan(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightCyan].

§Example
println!("{}", value.bright_cyan());
Source§

fn bright_white(&self) -> Painted<&T>

Returns self with the fg() set to [Color :: BrightWhite].

§Example
println!("{}", value.bright_white());
Source§

fn bg(&self, value: Color) -> Painted<&T>

Returns a styled value derived from self with the background set to value.

This method should be used rarely. Instead, prefer to use color-specific builder methods like on_red() and on_green(), which have the same functionality but are pithier.

§Example

Set background color to red using fg():

use yansi::{Paint, Color};

painted.bg(Color::Red);

Set background color to red using on_red().

use yansi::Paint;

painted.on_red();
Source§

fn on_primary(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Primary].

§Example
println!("{}", value.on_primary());
Source§

fn on_fixed(&self, color: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Fixed].

§Example
println!("{}", value.on_fixed(color));
Source§

fn on_rgb(&self, r: u8, g: u8, b: u8) -> Painted<&T>

Returns self with the bg() set to [Color :: Rgb].

§Example
println!("{}", value.on_rgb(r, g, b));
Source§

fn on_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Black].

§Example
println!("{}", value.on_black());
Source§

fn on_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Red].

§Example
println!("{}", value.on_red());
Source§

fn on_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Green].

§Example
println!("{}", value.on_green());
Source§

fn on_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Yellow].

§Example
println!("{}", value.on_yellow());
Source§

fn on_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Blue].

§Example
println!("{}", value.on_blue());
Source§

fn on_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Magenta].

§Example
println!("{}", value.on_magenta());
Source§

fn on_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: Cyan].

§Example
println!("{}", value.on_cyan());
Source§

fn on_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: White].

§Example
println!("{}", value.on_white());
Source§

fn on_bright_black(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlack].

§Example
println!("{}", value.on_bright_black());
Source§

fn on_bright_red(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightRed].

§Example
println!("{}", value.on_bright_red());
Source§

fn on_bright_green(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightGreen].

§Example
println!("{}", value.on_bright_green());
Source§

fn on_bright_yellow(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightYellow].

§Example
println!("{}", value.on_bright_yellow());
Source§

fn on_bright_blue(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightBlue].

§Example
println!("{}", value.on_bright_blue());
Source§

fn on_bright_magenta(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightMagenta].

§Example
println!("{}", value.on_bright_magenta());
Source§

fn on_bright_cyan(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightCyan].

§Example
println!("{}", value.on_bright_cyan());
Source§

fn on_bright_white(&self) -> Painted<&T>

Returns self with the bg() set to [Color :: BrightWhite].

§Example
println!("{}", value.on_bright_white());
Source§

fn attr(&self, value: Attribute) -> Painted<&T>

Enables the styling Attribute value.

This method should be used rarely. Instead, prefer to use attribute-specific builder methods like bold() and underline(), which have the same functionality but are pithier.

§Example

Make text bold using attr():

use yansi::{Paint, Attribute};

painted.attr(Attribute::Bold);

Make text bold using using bold().

use yansi::Paint;

painted.bold();
Source§

fn bold(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Bold].

§Example
println!("{}", value.bold());
Source§

fn dim(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Dim].

§Example
println!("{}", value.dim());
Source§

fn italic(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Italic].

§Example
println!("{}", value.italic());
Source§

fn underline(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Underline].

§Example
println!("{}", value.underline());

Returns self with the attr() set to [Attribute :: Blink].

§Example
println!("{}", value.blink());

Returns self with the attr() set to [Attribute :: RapidBlink].

§Example
println!("{}", value.rapid_blink());
Source§

fn invert(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Invert].

§Example
println!("{}", value.invert());
Source§

fn conceal(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Conceal].

§Example
println!("{}", value.conceal());
Source§

fn strike(&self) -> Painted<&T>

Returns self with the attr() set to [Attribute :: Strike].

§Example
println!("{}", value.strike());
Source§

fn quirk(&self, value: Quirk) -> Painted<&T>

Enables the yansi Quirk value.

This method should be used rarely. Instead, prefer to use quirk-specific builder methods like mask() and wrap(), which have the same functionality but are pithier.

§Example

Enable wrapping using .quirk():

use yansi::{Paint, Quirk};

painted.quirk(Quirk::Wrap);

Enable wrapping using wrap().

use yansi::Paint;

painted.wrap();
Source§

fn mask(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Mask].

§Example
println!("{}", value.mask());
Source§

fn wrap(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Wrap].

§Example
println!("{}", value.wrap());
Source§

fn linger(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Linger].

§Example
println!("{}", value.linger());
Source§

fn clear(&self) -> Painted<&T>

👎Deprecated since 1.0.1:

renamed to resetting() due to conflicts with Vec::clear(). The clear() method will be removed in a future release.

Returns self with the quirk() set to [Quirk :: Clear].

§Example
println!("{}", value.clear());
Source§

fn resetting(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Resetting].

§Example
println!("{}", value.resetting());
Source§

fn bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: Bright].

§Example
println!("{}", value.bright());
Source§

fn on_bright(&self) -> Painted<&T>

Returns self with the quirk() set to [Quirk :: OnBright].

§Example
println!("{}", value.on_bright());
Source§

fn whenever(&self, value: Condition) -> Painted<&T>

Conditionally enable styling based on whether the Condition value applies. Replaces any previous condition.

See the crate level docs for more details.

§Example

Enable styling painted only when both stdout and stderr are TTYs:

use yansi::{Paint, Condition};

painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);
Source§

fn new(self) -> Painted<Self>
where Self: Sized,

Create a new Painted with a default Style. Read more
Source§

fn paint<S>(&self, style: S) -> Painted<&Self>
where S: Into<Style>,

Apply a style wholesale to self. Any previous style is replaced. Read more
Source§

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

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
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> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

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

fn with_current_subscriber(self) -> WithDispatch<Self>

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

impl<T> SyncDeps for T