pub struct GateChip<F: ScalarField> {
pub pow_of_two: Vec<F>,
pub field_element_cache: Vec<F>,
}
Expand description
A chip that implements the GateInstructions trait supporting basic arithmetic operations.
Fields§
§pow_of_two: Vec<F>
The field elements 2^i for i in 0..F::NUM_BITS.
field_element_cache: Vec<F>
To avoid Montgomery conversion in F::from
for common small numbers, we keep a cache of field elements.
Implementations§
Trait Implementations§
Source§impl<F: ScalarField> Default for GateChip<F>
impl<F: ScalarField> Default for GateChip<F>
Source§impl<F: ScalarField> GateInstructions<F> for GateChip<F>
impl<F: ScalarField> GateInstructions<F> for GateChip<F>
Source§fn pow_of_two(&self) -> &[F]
fn pow_of_two(&self) -> &[F]
Returns a slice of the ScalarField elements 2i for i in 0..F::NUM_BITS.
Source§fn inner_product<QA>(
&self,
ctx: &mut Context<F>,
a: impl IntoIterator<Item = QA>,
b: impl IntoIterator<Item = QuantumCell<F>>,
) -> AssignedValue<F>where
QA: Into<QuantumCell<F>>,
fn inner_product<QA>(
&self,
ctx: &mut Context<F>,
a: impl IntoIterator<Item = QA>,
b: impl IntoIterator<Item = QuantumCell<F>>,
) -> AssignedValue<F>where
QA: Into<QuantumCell<F>>,
Constrains and returns the inner product of <a, b>
.
If the first element of b
is Constant(F::ONE)
, then an optimization is performed to save 3 cells.
Assumes ‘a’ and ‘b’ are the same length.
ctx
: Context to add the constraints toa
: Iterator of QuantumCell valuesb
: Iterator of QuantumCell values to take inner product ofa
by
Source§fn inner_product_left_last<QA>(
&self,
ctx: &mut Context<F>,
a: impl IntoIterator<Item = QA>,
b: impl IntoIterator<Item = QuantumCell<F>>,
) -> (AssignedValue<F>, AssignedValue<F>)where
QA: Into<QuantumCell<F>>,
fn inner_product_left_last<QA>(
&self,
ctx: &mut Context<F>,
a: impl IntoIterator<Item = QA>,
b: impl IntoIterator<Item = QuantumCell<F>>,
) -> (AssignedValue<F>, AssignedValue<F>)where
QA: Into<QuantumCell<F>>,
Returns the inner product of <a, b>
and the last element of a
after it has been assigned.
NOT encouraged for general usage.
This is a low-level function, where you want to avoid first assigning a
and then copying the last element into the
correct cell for this computation.
Assumes ‘a’ and ‘b’ are the same length.
ctx
: Context of the circuita
: Iterator of QuantumCellsb
: Iterator of QuantumCells to take inner product ofa
by
Source§fn inner_product_left<QA>(
&self,
ctx: &mut Context<F>,
a: impl IntoIterator<Item = QA>,
b: impl IntoIterator<Item = QuantumCell<F>>,
) -> (AssignedValue<F>, Vec<AssignedValue<F>>)where
QA: Into<QuantumCell<F>>,
fn inner_product_left<QA>(
&self,
ctx: &mut Context<F>,
a: impl IntoIterator<Item = QA>,
b: impl IntoIterator<Item = QuantumCell<F>>,
) -> (AssignedValue<F>, Vec<AssignedValue<F>>)where
QA: Into<QuantumCell<F>>,
Returns (<a,b>, a_assigned)
. See inner_product
for more details.
NOT encouraged for general usage.
This is a low-level function, useful for when you want to simultaneously compute an inner product while assigning
private witnesses for the first time. This avoids first assigning a
and then copying into the correct cells
for this computation. We do not return the assignments of a
in inner_product
as an optimization to avoid
the memory allocation of having to collect the vectors.
We do not return b_assigned
because if b
starts with Constant(F::ONE)
, the first element of b
is not assigned.
Assumes ‘a’ and ‘b’ are the same length.
Source§fn inner_product_with_sums<'thread, QA>(
&self,
ctx: &'thread mut Context<F>,
a: impl IntoIterator<Item = QA>,
b: impl IntoIterator<Item = QuantumCell<F>>,
) -> Box<dyn Iterator<Item = AssignedValue<F>> + 'thread>where
QA: Into<QuantumCell<F>>,
fn inner_product_with_sums<'thread, QA>(
&self,
ctx: &'thread mut Context<F>,
a: impl IntoIterator<Item = QA>,
b: impl IntoIterator<Item = QuantumCell<F>>,
) -> Box<dyn Iterator<Item = AssignedValue<F>> + 'thread>where
QA: Into<QuantumCell<F>>,
Calculates and constrains the inner product.
Returns the assignment trace where output[i]
has the running sum sum_{j=0..=i} a[j] * b[j]
.
Assumes ‘a’ and ‘b’ are the same length.
ctx
: Context to add the constraints toa
: Iterator of QuantumCell valuesb
: Iterator of QuantumCell values to calculate the partial sums of the inner product ofa
by
Source§fn sum_products_with_coeff_and_var(
&self,
ctx: &mut Context<F>,
values: impl IntoIterator<Item = (F, QuantumCell<F>, QuantumCell<F>)>,
var: QuantumCell<F>,
) -> AssignedValue<F>
fn sum_products_with_coeff_and_var( &self, ctx: &mut Context<F>, values: impl IntoIterator<Item = (F, QuantumCell<F>, QuantumCell<F>)>, var: QuantumCell<F>, ) -> AssignedValue<F>
Constrains and returns the sum of products of coeff * (a * b)
defined in values
plus a variable var
e.g.
x = var + values[0].0 * (values[0].1 * values[0].2) + values[1].0 * (values[1].1 * values[1].2) + ... + values[n].0 * (values[n].1 * values[n].2)
.
ctx
: Context to add the constraints tovalues
: Iterator of tuples(coeff, a, b)
wherecoeff
is a field element,a
andb
are QuantumCell’svar
: QuantumCell that represents the value of a variable added to the sum
Source§fn select(
&self,
ctx: &mut Context<F>,
a: impl Into<QuantumCell<F>>,
b: impl Into<QuantumCell<F>>,
sel: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>
fn select( &self, ctx: &mut Context<F>, a: impl Into<QuantumCell<F>>, b: impl Into<QuantumCell<F>>, sel: impl Into<QuantumCell<F>>, ) -> AssignedValue<F>
Constrains and returns sel ? a : b
assuming sel
is boolean.
Defines a vertical gate of form | 1 - sel | sel | 1 | a | 1 - sel | sel | 1 | b | out |
, where out = sel * a + (1 - sel) * b.
ctx
: Context to add the constraints toa
: QuantumCell that contains a boolean valueb
: QuantumCell that contains a boolean valuesel
: QuantumCell that contains a boolean value
Source§fn or_and(
&self,
ctx: &mut Context<F>,
a: impl Into<QuantumCell<F>>,
b: impl Into<QuantumCell<F>>,
c: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>
fn or_and( &self, ctx: &mut Context<F>, a: impl Into<QuantumCell<F>>, b: impl Into<QuantumCell<F>>, c: impl Into<QuantumCell<F>>, ) -> AssignedValue<F>
Constains and returns a || (b && c)
, assuming a
, b
and c
are boolean.
Defines a vertical gate of form | 1 - b c | b | c | 1 | a - 1 | 1 - b c | out | a - 1 | 1 | 1 | a |
, where out = a + b * c - a * b * c.
ctx
: Context to add the constraints toa
: QuantumCell that contains a boolean valueb
: QuantumCell that contains a boolean valuec
: QuantumCell that contains a boolean value
Source§fn num_to_bits(
&self,
ctx: &mut Context<F>,
a: AssignedValue<F>,
range_bits: usize,
) -> Vec<AssignedValue<F>>
fn num_to_bits( &self, ctx: &mut Context<F>, a: AssignedValue<F>, range_bits: usize, ) -> Vec<AssignedValue<F>>
Constrains and returns little-endian bit vector representation of a
.
Assumes range_bits >= number of bits in a
.
a
: QuantumCell of the value to convertrange_bits
: range of bits needed to representa
. Assumesrange_bits > 0
.
Source§fn pow_var(
&self,
ctx: &mut Context<F>,
a: AssignedValue<F>,
exp: AssignedValue<F>,
max_bits: usize,
) -> AssignedValue<F>
fn pow_var( &self, ctx: &mut Context<F>, a: AssignedValue<F>, exp: AssignedValue<F>, max_bits: usize, ) -> AssignedValue<F>
Constrains and computes a^exp
where both a, exp
are witnesses. The exponent is computed in the native field F
.
Constrains that exp
has at most max_bits
bits.
Source§fn add(
&self,
ctx: &mut Context<F>,
a: impl Into<QuantumCell<F>>,
b: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>
fn add( &self, ctx: &mut Context<F>, a: impl Into<QuantumCell<F>>, b: impl Into<QuantumCell<F>>, ) -> AssignedValue<F>
a + b * 1 = out
. Read moreSource§fn inc(
&self,
ctx: &mut Context<F>,
a: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>
fn inc( &self, ctx: &mut Context<F>, a: impl Into<QuantumCell<F>>, ) -> AssignedValue<F>
out = a + 1
. Read moreSource§fn sub(
&self,
ctx: &mut Context<F>,
a: impl Into<QuantumCell<F>>,
b: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>
fn sub( &self, ctx: &mut Context<F>, a: impl Into<QuantumCell<F>>, b: impl Into<QuantumCell<F>>, ) -> AssignedValue<F>
a + b * (-1) = out
. Read moreSource§fn dec(
&self,
ctx: &mut Context<F>,
a: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>
fn dec( &self, ctx: &mut Context<F>, a: impl Into<QuantumCell<F>>, ) -> AssignedValue<F>
out = a - 1
. Read moreSource§fn sub_mul(
&self,
ctx: &mut Context<F>,
a: impl Into<QuantumCell<F>>,
b: impl Into<QuantumCell<F>>,
c: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>
fn sub_mul( &self, ctx: &mut Context<F>, a: impl Into<QuantumCell<F>>, b: impl Into<QuantumCell<F>>, c: impl Into<QuantumCell<F>>, ) -> AssignedValue<F>
a - b * c = out
. Read moreSource§fn neg(
&self,
ctx: &mut Context<F>,
a: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>
fn neg( &self, ctx: &mut Context<F>, a: impl Into<QuantumCell<F>>, ) -> AssignedValue<F>
a * (-1) = out
. Read moreSource§fn mul(
&self,
ctx: &mut Context<F>,
a: impl Into<QuantumCell<F>>,
b: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>
fn mul( &self, ctx: &mut Context<F>, a: impl Into<QuantumCell<F>>, b: impl Into<QuantumCell<F>>, ) -> AssignedValue<F>
0 + a * b = out
. Read moreSource§fn mul_add(
&self,
ctx: &mut Context<F>,
a: impl Into<QuantumCell<F>>,
b: impl Into<QuantumCell<F>>,
c: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>
fn mul_add( &self, ctx: &mut Context<F>, a: impl Into<QuantumCell<F>>, b: impl Into<QuantumCell<F>>, c: impl Into<QuantumCell<F>>, ) -> AssignedValue<F>
a * b + c = out
. Read moreSource§fn mul_not(
&self,
ctx: &mut Context<F>,
a: impl Into<QuantumCell<F>>,
b: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>
fn mul_not( &self, ctx: &mut Context<F>, a: impl Into<QuantumCell<F>>, b: impl Into<QuantumCell<F>>, ) -> AssignedValue<F>
(1 - a) * b = b - a * b
. Read moreSource§fn assert_bit(&self, ctx: &mut Context<F>, x: AssignedValue<F>)
fn assert_bit(&self, ctx: &mut Context<F>, x: AssignedValue<F>)
Source§fn div_unsafe(
&self,
ctx: &mut Context<F>,
a: impl Into<QuantumCell<F>>,
b: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>
fn div_unsafe( &self, ctx: &mut Context<F>, a: impl Into<QuantumCell<F>>, b: impl Into<QuantumCell<F>>, ) -> AssignedValue<F>
Source§fn assert_is_const(
&self,
ctx: &mut Context<F>,
a: &AssignedValue<F>,
constant: &F,
)
fn assert_is_const( &self, ctx: &mut Context<F>, a: &AssignedValue<F>, constant: &F, )
Source§fn sum<Q>(
&self,
ctx: &mut Context<F>,
a: impl IntoIterator<Item = Q>,
) -> AssignedValue<F>where
Q: Into<QuantumCell<F>>,
fn sum<Q>(
&self,
ctx: &mut Context<F>,
a: impl IntoIterator<Item = Q>,
) -> AssignedValue<F>where
Q: Into<QuantumCell<F>>,
Source§fn partial_sums<'thread, Q>(
&self,
ctx: &'thread mut Context<F>,
a: impl IntoIterator<Item = Q>,
) -> Box<dyn Iterator<Item = AssignedValue<F>> + 'thread>where
Q: Into<QuantumCell<F>>,
fn partial_sums<'thread, Q>(
&self,
ctx: &'thread mut Context<F>,
a: impl IntoIterator<Item = Q>,
) -> Box<dyn Iterator<Item = AssignedValue<F>> + 'thread>where
Q: Into<QuantumCell<F>>,
a
. Read moreSource§fn accumulated_product<QA, QB>(
&self,
ctx: &mut Context<F>,
a: impl IntoIterator<Item = QA>,
b: impl IntoIterator<Item = QB>,
) -> Vec<AssignedValue<F>>
fn accumulated_product<QA, QB>( &self, ctx: &mut Context<F>, a: impl IntoIterator<Item = QA>, b: impl IntoIterator<Item = QB>, ) -> Vec<AssignedValue<F>>
x_i = b_1 * (a_1...a_{i - 1}) + b_2 * (a_2...a_{i - 1}) + ... + b_i
Read moreSource§fn or(
&self,
ctx: &mut Context<F>,
a: impl Into<QuantumCell<F>>,
b: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>
fn or( &self, ctx: &mut Context<F>, a: impl Into<QuantumCell<F>>, b: impl Into<QuantumCell<F>>, ) -> AssignedValue<F>
Source§fn and(
&self,
ctx: &mut Context<F>,
a: impl Into<QuantumCell<F>>,
b: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>
fn and( &self, ctx: &mut Context<F>, a: impl Into<QuantumCell<F>>, b: impl Into<QuantumCell<F>>, ) -> AssignedValue<F>
Source§fn not(
&self,
ctx: &mut Context<F>,
a: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>
fn not( &self, ctx: &mut Context<F>, a: impl Into<QuantumCell<F>>, ) -> AssignedValue<F>
Source§fn bits_to_indicator(
&self,
ctx: &mut Context<F>,
bits: &[AssignedValue<F>],
) -> Vec<AssignedValue<F>>
fn bits_to_indicator( &self, ctx: &mut Context<F>, bits: &[AssignedValue<F>], ) -> Vec<AssignedValue<F>>
output[idx] = 1
iff idx = (the number represented by bits
in binary little endian), otherwise output[idx] = 0
. Read moreSource§fn idx_to_indicator(
&self,
ctx: &mut Context<F>,
idx: impl Into<QuantumCell<F>>,
len: usize,
) -> Vec<AssignedValue<F>>
fn idx_to_indicator( &self, ctx: &mut Context<F>, idx: impl Into<QuantumCell<F>>, len: usize, ) -> Vec<AssignedValue<F>>
Source§fn select_by_indicator<Q>(
&self,
ctx: &mut Context<F>,
a: impl IntoIterator<Item = Q>,
indicator: impl IntoIterator<Item = AssignedValue<F>>,
) -> AssignedValue<F>where
Q: Into<QuantumCell<F>>,
fn select_by_indicator<Q>(
&self,
ctx: &mut Context<F>,
a: impl IntoIterator<Item = Q>,
indicator: impl IntoIterator<Item = AssignedValue<F>>,
) -> AssignedValue<F>where
Q: Into<QuantumCell<F>>,
a
and indicator
and returns a[idx]
(e.g. the value of a
at idx
). Read moreSource§fn select_from_idx<Q>(
&self,
ctx: &mut Context<F>,
cells: impl IntoIterator<Item = Q>,
idx: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>where
Q: Into<QuantumCell<F>>,
fn select_from_idx<Q>(
&self,
ctx: &mut Context<F>,
cells: impl IntoIterator<Item = Q>,
idx: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>where
Q: Into<QuantumCell<F>>,
Source§fn select_array_by_indicator<AR, AV>(
&self,
ctx: &mut Context<F>,
array2d: &[AR],
indicator: &[AssignedValue<F>],
) -> Vec<AssignedValue<F>>
fn select_array_by_indicator<AR, AV>( &self, ctx: &mut Context<F>, array2d: &[AR], indicator: &[AssignedValue<F>], ) -> Vec<AssignedValue<F>>
array2d
is an array of fixed length arrays.
Assumes: Read moreSource§fn is_zero(&self, ctx: &mut Context<F>, a: AssignedValue<F>) -> AssignedValue<F>
fn is_zero(&self, ctx: &mut Context<F>, a: AssignedValue<F>) -> AssignedValue<F>
Source§fn is_equal(
&self,
ctx: &mut Context<F>,
a: impl Into<QuantumCell<F>>,
b: impl Into<QuantumCell<F>>,
) -> AssignedValue<F>
fn is_equal( &self, ctx: &mut Context<F>, a: impl Into<QuantumCell<F>>, b: impl Into<QuantumCell<F>>, ) -> AssignedValue<F>
1
if a = b
, otherwise 0
. Read moreSource§fn lagrange_and_eval(
&self,
ctx: &mut Context<F>,
coords: &[(AssignedValue<F>, AssignedValue<F>)],
x: AssignedValue<F>,
) -> (AssignedValue<F>, AssignedValue<F>)
fn lagrange_and_eval( &self, ctx: &mut Context<F>, coords: &[(AssignedValue<F>, AssignedValue<F>)], x: AssignedValue<F>, ) -> (AssignedValue<F>, AssignedValue<F>)
coords
and evaluates the resulting polynomial at x
. Read moreAuto Trait Implementations§
impl<F> Freeze for GateChip<F>
impl<F> RefUnwindSafe for GateChip<F>where
F: RefUnwindSafe,
impl<F> Send for GateChip<F>
impl<F> Sync for GateChip<F>
impl<F> Unpin for GateChip<F>where
F: Unpin,
impl<F> UnwindSafe for GateChip<F>where
F: UnwindSafe,
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> 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.