pub struct ZkStdLib { /* private fields */ }Expand description
The ZkStdLib exposes all tools that are used in circuit generation.
Implementations§
Source§impl ZkStdLib
impl ZkStdLib
Sourcepub fn new(config: &ZkStdLibConfig, max_bit_len: usize) -> Self
pub fn new(config: &ZkStdLibConfig, max_bit_len: usize) -> Self
Creates a new ZkStdLib given its config.
Sourcepub fn configure(
meta: &mut ConstraintSystem<Fq>,
(arch, max_bit_len): (ZkStdLibArch, u8),
) -> ZkStdLibConfig
pub fn configure( meta: &mut ConstraintSystem<Fq>, (arch, max_bit_len): (ZkStdLibArch, u8), ) -> ZkStdLibConfig
Configure ZkStdLib from scratch.
Source§impl ZkStdLib
impl ZkStdLib
Sourcepub fn jubjub(&self) -> &EccChip<JubjubExtended>
pub fn jubjub(&self) -> &EccChip<JubjubExtended>
Native EccChip.
Sourcepub fn biguint(
&self,
) -> &BigUintGadget<Fq, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>
pub fn biguint( &self, ) -> &BigUintGadget<Fq, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>
Gadget for performing in-circuit big-unsigned integer operations.
Sourcepub fn map_gadget(
&self,
) -> &MapGadget<Fq, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>, PoseidonChip<Fq>>
pub fn map_gadget( &self, ) -> &MapGadget<Fq, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>, PoseidonChip<Fq>>
Gadget for performing map and non-map checks
Sourcepub fn secp256k1(
&self,
) -> &ForeignWeierstrassEccChip<Fq, K256, MultiEmulationParams, FieldChip<Fq, Fq, MultiEmulationParams, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>
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.
Sourcepub fn p256(
&self,
) -> &ForeignWeierstrassEccChip<Fq, P256, MultiEmulationParams, FieldChip<Fq, Fq, MultiEmulationParams, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>
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.
Sourcepub fn bls12_381(
&self,
) -> &ForeignWeierstrassEccChip<Fq, G1Projective, G1Projective, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>
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.
Sourcepub fn curve25519(
&self,
) -> &ForeignEdwardsEccChip<Fq, Curve25519, MultiEmulationParams, FieldChip<Fq, Scalar, MultiEmulationParams, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>
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.
Sourcepub fn base64(&self) -> &Base64Chip<Fq>
pub fn base64(&self) -> &Base64Chip<Fq>
Chip for performing in-circuit base64 decoding.
Sourcepub fn parser(
&self,
) -> &ParserGadget<Fq, NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>>
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).
Sourcepub fn scanner(&self) -> &ScannerChip<Fq>
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.
Sourcepub fn verifier(&self) -> &VerifierGadget<BlstrsEmulation>
pub fn verifier(&self) -> &VerifierGadget<BlstrsEmulation>
Chip for performing in-circuit verification of proofs (generated with Poseidon as the Fiat-Shamir transcript hash).
Sourcepub fn assert_true(
&self,
layouter: &mut impl Layouter<Fq>,
input: &AssignedBit<Fq>,
) -> Result<(), Error>
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)?;Sourcepub fn assert_false(
&self,
layouter: &mut impl Layouter<Fq>,
input: &AssignedBit<Fq>,
) -> Result<(), Error>
pub fn assert_false( &self, layouter: &mut impl Layouter<Fq>, input: &AssignedBit<Fq>, ) -> Result<(), Error>
Assert that a given assigned bit is false
Sourcepub fn lower_than(
&self,
layouter: &mut impl Layouter<Fq>,
x: &AssignedNative<Fq>,
y: &AssignedNative<Fq>,
n: u32,
) -> Result<AssignedBit<Fq>, Error>
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.
Sourcepub fn poseidon(
&self,
layouter: &mut impl Layouter<Fq>,
input: &[AssignedNative<Fq>],
) -> Result<AssignedNative<Fq>, Error>
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])?;Sourcepub fn poseidon_varlen<const M: usize>(
&self,
layouter: &mut impl Layouter<Fq>,
input: &AssignedVector<Fq, AssignedNative<Fq>, M, RATE>,
) -> Result<AssignedNative<Fq>, Error>
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).
Sourcepub fn hash_to_curve(
&self,
layouter: &mut impl Layouter<Fq>,
inputs: &[AssignedNative<Fq>],
) -> Result<AssignedNativePoint<JubjubExtended>, Error>
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.
Sourcepub fn sha2_256(
&self,
layouter: &mut impl Layouter<Fq>,
input: &[AssignedByte<Fq>],
) -> Result<[AssignedByte<Fq>; 32], Error>
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)?;Sourcepub 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>
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).
Sourcepub fn sha2_512(
&self,
layouter: &mut impl Layouter<Fq>,
input: &[AssignedByte<Fq>],
) -> Result<[AssignedByte<Fq>; 64], Error>
pub fn sha2_512( &self, layouter: &mut impl Layouter<Fq>, input: &[AssignedByte<Fq>], ) -> Result<[AssignedByte<Fq>; 64], Error>
SHA2-512 hash.
Sourcepub fn sha3_256(
&self,
layouter: &mut impl Layouter<Fq>,
input: &[AssignedByte<Fq>],
) -> Result<[AssignedByte<Fq>; 32], Error>
pub fn sha3_256( &self, layouter: &mut impl Layouter<Fq>, input: &[AssignedByte<Fq>], ) -> Result<[AssignedByte<Fq>; 32], Error>
SHA3-256 hash (third-party implementation).
Sourcepub fn keccak_256(
&self,
layouter: &mut impl Layouter<Fq>,
input: &[AssignedByte<Fq>],
) -> Result<[AssignedByte<Fq>; 32], Error>
pub fn keccak_256( &self, layouter: &mut impl Layouter<Fq>, input: &[AssignedByte<Fq>], ) -> Result<[AssignedByte<Fq>; 32], Error>
Keccak-256 hash (third-party implementation).
Sourcepub fn blake2b_256(
&self,
layouter: &mut impl Layouter<Fq>,
input: &[AssignedByte<Fq>],
) -> Result<[AssignedByte<Fq>; 32], Error>
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).
Sourcepub fn blake2b_512(
&self,
layouter: &mut impl Layouter<Fq>,
input: &[AssignedByte<Fq>],
) -> Result<[AssignedByte<Fq>; 64], Error>
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
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>
fn linear_combination( &self, layouter: &mut impl Layouter<Fq>, terms: &[(Fq, AssignedNative<Fq>)], constant: Fq, ) -> Result<AssignedNative<Fq>, Error>
(coeff_i, x_i) and a constant k, returns
k + (sum_i coeff_i * x_i). Read moreSource§fn mul(
&self,
layouter: &mut impl Layouter<Fq>,
x: &AssignedNative<Fq>,
y: &AssignedNative<Fq>,
multiplying_constant: Option<Fq>,
) -> Result<AssignedNative<Fq>, Error>
fn mul( &self, layouter: &mut impl Layouter<Fq>, x: &AssignedNative<Fq>, y: &AssignedNative<Fq>, multiplying_constant: Option<Fq>, ) -> Result<AssignedNative<Fq>, Error>
Source§fn div(
&self,
layouter: &mut impl Layouter<Fq>,
x: &AssignedNative<Fq>,
y: &AssignedNative<Fq>,
) -> Result<AssignedNative<Fq>, Error>
fn div( &self, layouter: &mut impl Layouter<Fq>, x: &AssignedNative<Fq>, y: &AssignedNative<Fq>, ) -> Result<AssignedNative<Fq>, Error>
Source§fn inv(
&self,
layouter: &mut impl Layouter<Fq>,
x: &AssignedNative<Fq>,
) -> Result<AssignedNative<Fq>, Error>
fn inv( &self, layouter: &mut impl Layouter<Fq>, x: &AssignedNative<Fq>, ) -> Result<AssignedNative<Fq>, Error>
x = 0. Read moreSource§fn inv0(
&self,
layouter: &mut impl Layouter<Fq>,
x: &AssignedNative<Fq>,
) -> Result<AssignedNative<Fq>, Error>
fn inv0( &self, layouter: &mut impl Layouter<Fq>, x: &AssignedNative<Fq>, ) -> Result<AssignedNative<Fq>, Error>
Source§fn add(
&self,
layouter: &mut impl Layouter<F>,
x: &Assigned,
y: &Assigned,
) -> Result<Assigned, Error>
fn add( &self, layouter: &mut impl Layouter<F>, x: &Assigned, y: &Assigned, ) -> Result<Assigned, Error>
Source§fn sub(
&self,
layouter: &mut impl Layouter<F>,
x: &Assigned,
y: &Assigned,
) -> Result<Assigned, Error>
fn sub( &self, layouter: &mut impl Layouter<F>, x: &Assigned, y: &Assigned, ) -> Result<Assigned, Error>
Source§fn neg(
&self,
layouter: &mut impl Layouter<F>,
x: &Assigned,
) -> Result<Assigned, Error>
fn neg( &self, layouter: &mut impl Layouter<F>, x: &Assigned, ) -> Result<Assigned, Error>
Source§fn add_constant(
&self,
layouter: &mut impl Layouter<F>,
x: &Assigned,
constant: <Assigned as InnerValue>::Element,
) -> Result<Assigned, Error>
fn add_constant( &self, layouter: &mut impl Layouter<F>, x: &Assigned, constant: <Assigned as InnerValue>::Element, ) -> Result<Assigned, Error>
Source§fn add_constants(
&self,
layouter: &mut impl Layouter<F>,
xs: &[Assigned],
constants: &[<Assigned as InnerValue>::Element],
) -> Result<Vec<Assigned>, Error>
fn add_constants( &self, layouter: &mut impl Layouter<F>, xs: &[Assigned], constants: &[<Assigned as InnerValue>::Element], ) -> Result<Vec<Assigned>, Error>
Source§fn mul_by_constant(
&self,
layouter: &mut impl Layouter<F>,
x: &Assigned,
constant: <Assigned as InnerValue>::Element,
) -> Result<Assigned, Error>
fn mul_by_constant( &self, layouter: &mut impl Layouter<F>, x: &Assigned, constant: <Assigned as InnerValue>::Element, ) -> Result<Assigned, Error>
Source§fn square(
&self,
layouter: &mut impl Layouter<F>,
x: &Assigned,
) -> Result<Assigned, Error>
fn square( &self, layouter: &mut impl Layouter<F>, x: &Assigned, ) -> Result<Assigned, Error>
Source§fn pow(
&self,
layouter: &mut impl Layouter<F>,
x: &Assigned,
n: u64,
) -> Result<Assigned, Error>
fn pow( &self, layouter: &mut impl Layouter<F>, x: &Assigned, n: u64, ) -> Result<Assigned, Error>
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>
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>
a*x + b*y + c*z + k + m*x*y.Source§impl<T> AssertionInstructions<Fq, T> for ZkStdLibwhere
T: InnerValue,
NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>: AssertionInstructions<Fq, T>,
impl<T> AssertionInstructions<Fq, T> for ZkStdLibwhere
T: InnerValue,
NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>: AssertionInstructions<Fq, T>,
Source§fn assert_equal(
&self,
layouter: &mut impl Layouter<Fq>,
x: &T,
y: &T,
) -> Result<(), Error>
fn assert_equal( &self, layouter: &mut impl Layouter<Fq>, x: &T, y: &T, ) -> Result<(), Error>
Source§fn assert_not_equal(
&self,
layouter: &mut impl Layouter<Fq>,
x: &T,
y: &T,
) -> Result<(), Error>
fn assert_not_equal( &self, layouter: &mut impl Layouter<Fq>, x: &T, y: &T, ) -> Result<(), Error>
Source§impl<T> AssignmentInstructions<Fq, T> for ZkStdLibwhere
T: InnerValue,
T::Element: Clone,
NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>: AssignmentInstructions<Fq, T>,
impl<T> AssignmentInstructions<Fq, T> for ZkStdLibwhere
T: InnerValue,
T::Element: Clone,
NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>: AssignmentInstructions<Fq, T>,
Source§fn assign(
&self,
layouter: &mut impl Layouter<Fq>,
value: Value<T::Element>,
) -> Result<T, Error>
fn assign( &self, layouter: &mut impl Layouter<Fq>, value: Value<T::Element>, ) -> Result<T, Error>
Source§fn assign_fixed(
&self,
layouter: &mut impl Layouter<Fq>,
constant: T::Element,
) -> Result<T, Error>
fn assign_fixed( &self, layouter: &mut impl Layouter<Fq>, constant: T::Element, ) -> Result<T, Error>
Source§fn assign_many(
&self,
layouter: &mut impl Layouter<Fq>,
values: &[Value<T::Element>],
) -> Result<Vec<T>, Error>
fn assign_many( &self, layouter: &mut impl Layouter<Fq>, values: &[Value<T::Element>], ) -> Result<Vec<T>, Error>
Source§fn assign_many_fixed(
&self,
layouter: &mut impl Layouter<F>,
values: &[<Assigned as InnerValue>::Element],
) -> Result<Vec<Assigned>, Error>
fn assign_many_fixed( &self, layouter: &mut impl Layouter<F>, values: &[<Assigned as InnerValue>::Element], ) -> Result<Vec<Assigned>, Error>
Source§impl BinaryInstructions<Fq> for ZkStdLib
impl BinaryInstructions<Fq> for ZkStdLib
Source§fn and(
&self,
layouter: &mut impl Layouter<Fq>,
bits: &[AssignedBit<Fq>],
) -> Result<AssignedBit<Fq>, Error>
fn and( &self, layouter: &mut impl Layouter<Fq>, bits: &[AssignedBit<Fq>], ) -> Result<AssignedBit<Fq>, Error>
Source§fn or(
&self,
layouter: &mut impl Layouter<Fq>,
bits: &[AssignedBit<Fq>],
) -> Result<AssignedBit<Fq>, Error>
fn or( &self, layouter: &mut impl Layouter<Fq>, bits: &[AssignedBit<Fq>], ) -> Result<AssignedBit<Fq>, Error>
Source§impl BitwiseInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib
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>
fn band( &self, layouter: &mut impl Layouter<F>, x: &Assigned, y: &Assigned, n: usize, ) -> Result<Assigned, Error>
n. Read moreSource§fn bor(
&self,
layouter: &mut impl Layouter<F>,
x: &Assigned,
y: &Assigned,
n: usize,
) -> Result<Assigned, Error>
fn bor( &self, layouter: &mut impl Layouter<F>, x: &Assigned, y: &Assigned, n: usize, ) -> Result<Assigned, Error>
n. Read moreSource§impl CanonicityInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib
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>
fn le_bits_lower_than( &self, layouter: &mut impl Layouter<Fq>, bits: &[AssignedBit<Fq>], bound: BigUint, ) -> Result<AssignedBit<Fq>, Error>
true iff the integer represented by the given sequence of
assigned bits, interpreted in little-endian, is strictly lower than the
given bound. Read moreSource§fn le_bits_geq_than(
&self,
layouter: &mut impl Layouter<Fq>,
bits: &[AssignedBit<Fq>],
bound: BigUint,
) -> Result<AssignedBit<Fq>, Error>
fn le_bits_geq_than( &self, layouter: &mut impl Layouter<Fq>, bits: &[AssignedBit<Fq>], bound: BigUint, ) -> Result<AssignedBit<Fq>, Error>
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>
fn is_canonical( &self, layouter: &mut impl Layouter<F>, bits: &[AssignedBit<F>], ) -> Result<AssignedBit<F>, Error>
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 moreSource§impl<T> CommittedInstanceInstructions<Fq, T> for ZkStdLibwhere
Fq: PrimeField,
T: Instantiable<Fq>,
NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>: CommittedInstanceInstructions<Fq, T>,
impl<T> CommittedInstanceInstructions<Fq, T> for ZkStdLibwhere
Fq: PrimeField,
T: Instantiable<Fq>,
NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>: CommittedInstanceInstructions<Fq, T>,
Source§impl<Assigned> ControlFlowInstructions<Fq, Assigned> for ZkStdLibwhere
Assigned: InnerValue,
NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>: ControlFlowInstructions<Fq, Assigned>,
impl<Assigned> ControlFlowInstructions<Fq, Assigned> for ZkStdLibwhere
Assigned: InnerValue,
NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>: ControlFlowInstructions<Fq, Assigned>,
Source§fn select(
&self,
layouter: &mut impl Layouter<Fq>,
cond: &AssignedBit<Fq>,
x: &Assigned,
y: &Assigned,
) -> Result<Assigned, Error>
fn select( &self, layouter: &mut impl Layouter<Fq>, cond: &AssignedBit<Fq>, x: &Assigned, y: &Assigned, ) -> Result<Assigned, Error>
Source§fn cond_swap(
&self,
layouter: &mut impl Layouter<Fq>,
cond: &AssignedBit<Fq>,
x: &Assigned,
y: &Assigned,
) -> Result<(Assigned, Assigned), Error>
fn cond_swap( &self, layouter: &mut impl Layouter<Fq>, cond: &AssignedBit<Fq>, x: &Assigned, y: &Assigned, ) -> Result<(Assigned, Assigned), Error>
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>
fn cond_assert_equal( &self, layouter: &mut impl Layouter<F>, cond: &AssignedBit<F>, x: &Assigned, y: &Assigned, ) -> Result<(), Error>
cond is set to 1.Source§impl<T1, T2> ConversionInstructions<Fq, T1, T2> for ZkStdLibwhere
T1: InnerValue,
T2: InnerValue,
NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>: ConversionInstructions<Fq, T1, T2>,
impl<T1, T2> ConversionInstructions<Fq, T1, T2> for ZkStdLibwhere
T1: InnerValue,
T2: InnerValue,
NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>: ConversionInstructions<Fq, T1, T2>,
Source§impl DecompositionInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib
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>
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>
Source§fn assigned_to_le_bytes(
&self,
layouter: &mut impl Layouter<Fq>,
x: &AssignedNative<Fq>,
nb_bytes: Option<usize>,
) -> Result<Vec<AssignedByte<Fq>>, Error>
fn assigned_to_le_bytes( &self, layouter: &mut impl Layouter<Fq>, x: &AssignedNative<Fq>, nb_bytes: Option<usize>, ) -> Result<Vec<AssignedByte<Fq>>, Error>
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>
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>
x. Read moreSource§fn sgn0(
&self,
layouter: &mut impl Layouter<Fq>,
x: &AssignedNative<Fq>,
) -> Result<AssignedBit<Fq>, Error>
fn sgn0( &self, layouter: &mut impl Layouter<Fq>, x: &AssignedNative<Fq>, ) -> Result<AssignedBit<Fq>, Error>
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>
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>
Source§fn assigned_to_be_bytes(
&self,
layouter: &mut impl Layouter<F>,
x: &Assigned,
nb_bytes: Option<usize>,
) -> Result<Vec<AssignedByte<F>>, Error>
fn assigned_to_be_bytes( &self, layouter: &mut impl Layouter<F>, x: &Assigned, nb_bytes: Option<usize>, ) -> Result<Vec<AssignedByte<F>>, Error>
Source§fn assigned_from_le_bits(
&self,
layouter: &mut impl Layouter<F>,
bits: &[AssignedBit<F>],
) -> Result<Assigned, Error>
fn assigned_from_le_bits( &self, layouter: &mut impl Layouter<F>, bits: &[AssignedBit<F>], ) -> Result<Assigned, Error>
Source§fn assigned_from_be_bits(
&self,
layouter: &mut impl Layouter<F>,
bits: &[AssignedBit<F>],
) -> Result<Assigned, Error>
fn assigned_from_be_bits( &self, layouter: &mut impl Layouter<F>, bits: &[AssignedBit<F>], ) -> Result<Assigned, Error>
Source§fn assigned_from_le_bytes(
&self,
layouter: &mut impl Layouter<F>,
bytes: &[AssignedByte<F>],
) -> Result<Assigned, Error>
fn assigned_from_le_bytes( &self, layouter: &mut impl Layouter<F>, bytes: &[AssignedByte<F>], ) -> Result<Assigned, Error>
Source§fn assigned_from_be_bytes(
&self,
layouter: &mut impl Layouter<F>,
bytes: &[AssignedByte<F>],
) -> Result<Assigned, Error>
fn assigned_from_be_bytes( &self, layouter: &mut impl Layouter<F>, bytes: &[AssignedByte<F>], ) -> Result<Assigned, Error>
Source§impl DivisionInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib
impl DivisionInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib
Source§impl<T> EqualityInstructions<Fq, T> for ZkStdLibwhere
T: InnerValue,
NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>: EqualityInstructions<Fq, T>,
impl<T> EqualityInstructions<Fq, T> for ZkStdLibwhere
T: InnerValue,
NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>: EqualityInstructions<Fq, T>,
Source§fn is_equal(
&self,
layouter: &mut impl Layouter<Fq>,
x: &T,
y: &T,
) -> Result<AssignedBit<Fq>, Error>
fn is_equal( &self, layouter: &mut impl Layouter<Fq>, x: &T, y: &T, ) -> Result<AssignedBit<Fq>, Error>
Source§fn is_not_equal(
&self,
layouter: &mut impl Layouter<Fq>,
x: &T,
y: &T,
) -> Result<AssignedBit<Fq>, Error>
fn is_not_equal( &self, layouter: &mut impl Layouter<Fq>, x: &T, y: &T, ) -> Result<AssignedBit<Fq>, Error>
0 if the elements are equal, returns 1 otherwise.Source§impl FieldInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib
impl FieldInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib
Source§impl<T> PublicInputInstructions<Fq, T> for ZkStdLibwhere
T: Instantiable<Fq>,
T::Element: Clone,
NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>: PublicInputInstructions<Fq, T>,
impl<T> PublicInputInstructions<Fq, T> for ZkStdLibwhere
T: Instantiable<Fq>,
T::Element: Clone,
NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>: PublicInputInstructions<Fq, T>,
Source§fn as_public_input(
&self,
layouter: &mut impl Layouter<Fq>,
assigned: &T,
) -> Result<Vec<AssignedNative<Fq>>, Error>
fn as_public_input( &self, layouter: &mut impl Layouter<Fq>, assigned: &T, ) -> Result<Vec<AssignedNative<Fq>>, Error>
Source§fn constrain_as_public_input(
&self,
layouter: &mut impl Layouter<Fq>,
assigned: &T,
) -> Result<(), Error>
fn constrain_as_public_input( &self, layouter: &mut impl Layouter<Fq>, assigned: &T, ) -> Result<(), Error>
Source§impl RangeCheckInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib
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>
fn assign_lower_than_fixed( &self, layouter: &mut impl Layouter<Fq>, value: Value<Fq>, bound: &BigUint, ) -> Result<AssignedNative<Fq>, Error>
Source§impl<const M: usize, const A: usize, T> VectorInstructions<Fq, T, M, A> for ZkStdLibwhere
T: Vectorizable,
T::Element: Copy,
NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>: AssignmentInstructions<Fq, T> + ControlFlowInstructions<Fq, T>,
impl<const M: usize, const A: usize, T> VectorInstructions<Fq, T, M, A> for ZkStdLibwhere
T: Vectorizable,
T::Element: Copy,
NativeGadget<Fq, P2RDecompositionChip<Fq>, NativeChip<Fq>>: AssignmentInstructions<Fq, T> + ControlFlowInstructions<Fq, T>,
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>
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>
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 moreSource§fn padding_flag(
&self,
layouter: &mut impl Layouter<Fq>,
input: &AssignedVector<Fq, T, M, A>,
) -> Result<(Box<[AssignedBit<Fq>; M]>, VectorBounds<Fq>), Error>
fn padding_flag( &self, layouter: &mut impl Layouter<Fq>, input: &AssignedVector<Fq, T, M, A>, ) -> Result<(Box<[AssignedBit<Fq>; M]>, VectorBounds<Fq>), Error>
Source§fn get_limits(
&self,
layouter: &mut impl Layouter<Fq>,
input: &AssignedVector<Fq, T, M, A>,
) -> Result<VectorBounds<Fq>, Error>
fn get_limits( &self, layouter: &mut impl Layouter<Fq>, input: &AssignedVector<Fq, T, M, A>, ) -> Result<VectorBounds<Fq>, Error>
Source§impl ZeroInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib
impl ZeroInstructions<Fq, AssignedCell<Fq, Fq>> for ZkStdLib
Source§fn assert_zero(
&self,
layouter: &mut impl Layouter<F>,
x: &Assigned,
) -> Result<(), Error>
fn assert_zero( &self, layouter: &mut impl Layouter<F>, x: &Assigned, ) -> Result<(), Error>
Auto Trait Implementations§
impl Freeze for ZkStdLib
impl !RefUnwindSafe for ZkStdLib
impl !Send for ZkStdLib
impl !Sync for ZkStdLib
impl Unpin for ZkStdLib
impl UnsafeUnpin for ZkStdLib
impl !UnwindSafe for ZkStdLib
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self to use its Binary implementation when Debug-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self to use its Display implementation when
Debug-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self to use its LowerExp implementation when
Debug-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self to use its LowerHex implementation when
Debug-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self to use its Octal implementation when Debug-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self to use its Pointer implementation when
Debug-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self to use its UpperExp implementation when
Debug-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self to use its UpperHex implementation when
Debug-formatted.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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 moreSource§impl<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
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 bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
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>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
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 rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
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 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.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
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§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
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
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
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
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.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
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.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
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.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
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.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
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.