#[repr(transparent)]pub struct Fr(_);
Expand description
Represents an element of the scalar field $\mathbb{F}_q$ of the BLS12-381 elliptic curve construction.
The inner representation blst_fr
is stored in Montgomery form as little-endian u64
limbs.
Implementations
sourceimpl Scalar
impl Scalar
sourcepub fn from_bytes_le(bytes: &[u8; 32]) -> CtOption<Scalar>
pub fn from_bytes_le(bytes: &[u8; 32]) -> CtOption<Scalar>
Attempts to convert a little-endian byte representation of
a scalar into a Scalar
, failing if the input is not canonical.
sourcepub fn from_bytes_be(be_bytes: &[u8; 32]) -> CtOption<Scalar>
pub fn from_bytes_be(be_bytes: &[u8; 32]) -> CtOption<Scalar>
Attempts to convert a big-endian byte representation of
a scalar into a Scalar
, failing if the input is not canonical.
sourcepub fn to_bytes_le(&self) -> [u8; 32]
pub fn to_bytes_le(&self) -> [u8; 32]
Converts an element of Scalar
into a byte representation in
little-endian byte order.
sourcepub fn to_bytes_be(&self) -> [u8; 32]
pub fn to_bytes_be(&self) -> [u8; 32]
Converts an element of Scalar
into a byte representation in
big-endian byte order.
pub fn from_u64s_le(bytes: &[u64; 4]) -> CtOption<Scalar>
pub fn is_quad_res(&self) -> Choice
pub fn legendre(&self) -> i8
pub fn char() -> <Scalar as PrimeField>::Repr
pub fn num_bits(&self) -> u32
sourcepub fn square_assign(&mut self)
pub fn square_assign(&mut self)
Calculates the square
of this element.
Trait Implementations
sourceimpl<'_> AddAssign<&'_ Scalar> for Scalar
impl<'_> AddAssign<&'_ Scalar> for Scalar
sourcefn add_assign(&mut self, rhs: &Scalar)
fn add_assign(&mut self, rhs: &Scalar)
Performs the +=
operation. Read more
sourceimpl AddAssign<Scalar> for Scalar
impl AddAssign<Scalar> for Scalar
sourcefn add_assign(&mut self, rhs: Scalar)
fn add_assign(&mut self, rhs: Scalar)
Performs the +=
operation. Read more
sourceimpl ConditionallySelectable for Scalar
impl ConditionallySelectable for Scalar
sourceimpl ConstantTimeEq for Scalar
impl ConstantTimeEq for Scalar
sourceimpl<'de> Deserialize<'de> for Scalar
impl<'de> Deserialize<'de> for Scalar
sourcefn deserialize<D>(d: D) -> Result<Scalar, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
fn deserialize<D>(d: D) -> Result<Scalar, <D as Deserializer<'de>>::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Field for Scalar
impl Field for Scalar
sourcefn random(rng: impl RngCore) -> Scalar
fn random(rng: impl RngCore) -> Scalar
Returns an element chosen uniformly at random using a user-provided RNG.
sourcefn invert(&self) -> CtOption<Scalar>
fn invert(&self) -> CtOption<Scalar>
Computes the multiplicative inverse of this element, failing if the element is zero. Read more
sourcefn sqrt(&self) -> CtOption<Scalar>
fn sqrt(&self) -> CtOption<Scalar>
Returns the square root of the field element, if it is quadratic residue. Read more
sourcefn is_zero_vartime(&self) -> bool
fn is_zero_vartime(&self) -> bool
Returns true iff this element is zero. Read more
sourceimpl Into<blst_scalar> for Scalar
impl Into<blst_scalar> for Scalar
sourcefn into(self) -> blst_scalar
fn into(self) -> blst_scalar
Converts this type into the (usually inferred) input type.
sourceimpl<'_> Mul<&'_ Scalar> for G1Projective
impl<'_> Mul<&'_ Scalar> for G1Projective
type Output = G1Projective
type Output = G1Projective
The resulting type after applying the *
operator.
sourcefn mul(self, rhs: &Scalar) -> G1Projective
fn mul(self, rhs: &Scalar) -> G1Projective
Performs the *
operation. Read more
sourceimpl<'_> Mul<&'_ Scalar> for G2Affine
impl<'_> Mul<&'_ Scalar> for G2Affine
type Output = G2Projective
type Output = G2Projective
The resulting type after applying the *
operator.
sourcefn mul(self, rhs: &Scalar) -> G2Projective
fn mul(self, rhs: &Scalar) -> G2Projective
Performs the *
operation. Read more
sourceimpl<'_> Mul<&'_ Scalar> for G1Affine
impl<'_> Mul<&'_ Scalar> for G1Affine
type Output = G1Projective
type Output = G1Projective
The resulting type after applying the *
operator.
sourcefn mul(self, rhs: &Scalar) -> G1Projective
fn mul(self, rhs: &Scalar) -> G1Projective
Performs the *
operation. Read more
sourceimpl<'_> Mul<&'_ Scalar> for G2Projective
impl<'_> Mul<&'_ Scalar> for G2Projective
type Output = G2Projective
type Output = G2Projective
The resulting type after applying the *
operator.
sourcefn mul(self, rhs: &Scalar) -> G2Projective
fn mul(self, rhs: &Scalar) -> G2Projective
Performs the *
operation. Read more
sourceimpl<'_, '_> Mul<&'_ Scalar> for &'_ G2Projective
impl<'_, '_> Mul<&'_ Scalar> for &'_ G2Projective
type Output = G2Projective
type Output = G2Projective
The resulting type after applying the *
operator.
sourceimpl<'_, '_> Mul<&'_ Scalar> for &'_ G1Projective
impl<'_, '_> Mul<&'_ Scalar> for &'_ G1Projective
type Output = G1Projective
type Output = G1Projective
The resulting type after applying the *
operator.
sourceimpl Mul<Scalar> for G1Affine
impl Mul<Scalar> for G1Affine
type Output = G1Projective
type Output = G1Projective
The resulting type after applying the *
operator.
sourcefn mul(self, rhs: Scalar) -> G1Projective
fn mul(self, rhs: Scalar) -> G1Projective
Performs the *
operation. Read more
sourceimpl Mul<Scalar> for G2Affine
impl Mul<Scalar> for G2Affine
type Output = G2Projective
type Output = G2Projective
The resulting type after applying the *
operator.
sourcefn mul(self, rhs: Scalar) -> G2Projective
fn mul(self, rhs: Scalar) -> G2Projective
Performs the *
operation. Read more
sourceimpl<'_> Mul<Scalar> for &'_ G1Affine
impl<'_> Mul<Scalar> for &'_ G1Affine
type Output = G1Projective
type Output = G1Projective
The resulting type after applying the *
operator.
sourcefn mul(self, rhs: Scalar) -> G1Projective
fn mul(self, rhs: Scalar) -> G1Projective
Performs the *
operation. Read more
sourceimpl Mul<Scalar> for G1Projective
impl Mul<Scalar> for G1Projective
type Output = G1Projective
type Output = G1Projective
The resulting type after applying the *
operator.
sourcefn mul(self, rhs: Scalar) -> G1Projective
fn mul(self, rhs: Scalar) -> G1Projective
Performs the *
operation. Read more
sourceimpl<'_> Mul<Scalar> for &'_ G1Projective
impl<'_> Mul<Scalar> for &'_ G1Projective
type Output = G1Projective
type Output = G1Projective
The resulting type after applying the *
operator.
sourcefn mul(self, rhs: Scalar) -> G1Projective
fn mul(self, rhs: Scalar) -> G1Projective
Performs the *
operation. Read more
sourceimpl<'_> Mul<Scalar> for &'_ G2Projective
impl<'_> Mul<Scalar> for &'_ G2Projective
type Output = G2Projective
type Output = G2Projective
The resulting type after applying the *
operator.
sourcefn mul(self, rhs: Scalar) -> G2Projective
fn mul(self, rhs: Scalar) -> G2Projective
Performs the *
operation. Read more
sourceimpl Mul<Scalar> for G2Projective
impl Mul<Scalar> for G2Projective
type Output = G2Projective
type Output = G2Projective
The resulting type after applying the *
operator.
sourcefn mul(self, rhs: Scalar) -> G2Projective
fn mul(self, rhs: Scalar) -> G2Projective
Performs the *
operation. Read more
sourceimpl<'_> Mul<Scalar> for &'_ G2Affine
impl<'_> Mul<Scalar> for &'_ G2Affine
type Output = G2Projective
type Output = G2Projective
The resulting type after applying the *
operator.
sourcefn mul(self, rhs: Scalar) -> G2Projective
fn mul(self, rhs: Scalar) -> G2Projective
Performs the *
operation. Read more
sourceimpl<'_> MulAssign<&'_ Scalar> for G2Affine
impl<'_> MulAssign<&'_ Scalar> for G2Affine
sourcefn mul_assign(&mut self, rhs: &Scalar)
fn mul_assign(&mut self, rhs: &Scalar)
Performs the *=
operation. Read more
sourceimpl<'_> MulAssign<&'_ Scalar> for Scalar
impl<'_> MulAssign<&'_ Scalar> for Scalar
sourcefn mul_assign(&mut self, rhs: &Scalar)
fn mul_assign(&mut self, rhs: &Scalar)
Performs the *=
operation. Read more
sourceimpl<'_> MulAssign<&'_ Scalar> for G1Affine
impl<'_> MulAssign<&'_ Scalar> for G1Affine
sourcefn mul_assign(&mut self, rhs: &Scalar)
fn mul_assign(&mut self, rhs: &Scalar)
Performs the *=
operation. Read more
sourceimpl<'_> MulAssign<&'_ Scalar> for G2Projective
impl<'_> MulAssign<&'_ Scalar> for G2Projective
sourcefn mul_assign(&mut self, rhs: &Scalar)
fn mul_assign(&mut self, rhs: &Scalar)
Performs the *=
operation. Read more
sourceimpl<'_> MulAssign<&'_ Scalar> for G1Projective
impl<'_> MulAssign<&'_ Scalar> for G1Projective
sourcefn mul_assign(&mut self, rhs: &Scalar)
fn mul_assign(&mut self, rhs: &Scalar)
Performs the *=
operation. Read more
sourceimpl MulAssign<Scalar> for Scalar
impl MulAssign<Scalar> for Scalar
sourcefn mul_assign(&mut self, rhs: Scalar)
fn mul_assign(&mut self, rhs: Scalar)
Performs the *=
operation. Read more
sourceimpl MulAssign<Scalar> for G2Projective
impl MulAssign<Scalar> for G2Projective
sourcefn mul_assign(&mut self, rhs: Scalar)
fn mul_assign(&mut self, rhs: Scalar)
Performs the *=
operation. Read more
sourceimpl MulAssign<Scalar> for G2Affine
impl MulAssign<Scalar> for G2Affine
sourcefn mul_assign(&mut self, rhs: Scalar)
fn mul_assign(&mut self, rhs: Scalar)
Performs the *=
operation. Read more
sourceimpl MulAssign<Scalar> for G1Projective
impl MulAssign<Scalar> for G1Projective
sourcefn mul_assign(&mut self, rhs: Scalar)
fn mul_assign(&mut self, rhs: Scalar)
Performs the *=
operation. Read more
sourceimpl MulAssign<Scalar> for G1Affine
impl MulAssign<Scalar> for G1Affine
sourcefn mul_assign(&mut self, rhs: Scalar)
fn mul_assign(&mut self, rhs: Scalar)
Performs the *=
operation. Read more
sourceimpl MulAssign<Scalar> for Poly
impl MulAssign<Scalar> for Poly
sourcefn mul_assign(&mut self, rhs: Fr)
fn mul_assign(&mut self, rhs: Fr)
Performs the *=
operation. Read more
sourceimpl Ord for Scalar
impl Ord for Scalar
sourceimpl PartialOrd<Scalar> for Scalar
impl PartialOrd<Scalar> for Scalar
sourcefn partial_cmp(&self, other: &Scalar) -> Option<Ordering>
fn partial_cmp(&self, other: &Scalar) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
sourceimpl PrimeField for Scalar
impl PrimeField for Scalar
sourcefn from_repr(repr: <Scalar as PrimeField>::Repr) -> CtOption<Scalar>
fn from_repr(repr: <Scalar as PrimeField>::Repr) -> CtOption<Scalar>
Converts a little-endian non-Montgomery form repr
into a Montgomery form Scalar
.
sourcefn to_repr(&self) -> <Scalar as PrimeField>::Repr
fn to_repr(&self) -> <Scalar as PrimeField>::Repr
Converts a Montgomery form Scalar
into little-endian non-Montgomery from.
type Repr = [u8; 32]
type Repr = [u8; 32]
The prime field can be converted back and forth into this binary representation. Read more
sourceconst CAPACITY: u32
const CAPACITY: u32
How many bits of information can be reliably stored in the field element. Read more
sourcefn from_repr_vartime(repr: <Scalar as PrimeField>::Repr) -> Option<Scalar>
fn from_repr_vartime(repr: <Scalar as PrimeField>::Repr) -> Option<Scalar>
Attempts to convert a byte representation of a field element into an element of this prime field, failing if the input is not canonical (is not smaller than the field’s modulus). Read more
sourcefn multiplicative_generator() -> Scalar
fn multiplicative_generator() -> Scalar
Returns a fixed multiplicative generator of modulus - 1
order. This element must
also be a quadratic nonresidue. Read more
sourcefn root_of_unity() -> Scalar
fn root_of_unity() -> Scalar
Returns the 2^s
root of unity. Read more
sourcefn from_str_vartime(s: &str) -> Option<Self>
fn from_str_vartime(s: &str) -> Option<Self>
Interpret a string of numbers as a (congruent) prime field element. Does not accept unnecessary leading zeroes or a blank string. Read more
sourceimpl PrimeFieldBits for Scalar
impl PrimeFieldBits for Scalar
sourcefn to_le_bits(&self) -> BitArray<Lsb0, <Scalar as PrimeFieldBits>::ReprBits>
fn to_le_bits(&self) -> BitArray<Lsb0, <Scalar as PrimeFieldBits>::ReprBits>
Converts an element of the prime field into a little-endian sequence of bits.
sourcefn char_le_bits() -> BitArray<Lsb0, <Scalar as PrimeFieldBits>::ReprBits>
fn char_le_bits() -> BitArray<Lsb0, <Scalar as PrimeFieldBits>::ReprBits>
Returns the bits of the field characteristic (the modulus) in little-endian order.
sourceimpl Serialize for Scalar
impl Serialize for Scalar
sourcefn serialize<S>(
&self,
s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
fn serialize<S>(
&self,
s: S
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
sourceimpl<'_> SubAssign<&'_ Scalar> for Scalar
impl<'_> SubAssign<&'_ Scalar> for Scalar
sourcefn sub_assign(&mut self, rhs: &Scalar)
fn sub_assign(&mut self, rhs: &Scalar)
Performs the -=
operation. Read more
sourceimpl SubAssign<Scalar> for Scalar
impl SubAssign<Scalar> for Scalar
sourcefn sub_assign(&mut self, rhs: Scalar)
fn sub_assign(&mut self, rhs: Scalar)
Performs the -=
operation. Read more
impl Copy for Scalar
impl Eq for Scalar
Auto Trait Implementations
impl RefUnwindSafe for Scalar
impl Send for Scalar
impl Sync for Scalar
impl Unpin for Scalar
impl UnwindSafe for Scalar
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ConditionallyNegatable for T where
T: ConditionallySelectable,
&'a T: for<'a> Neg,
<&'a T as Neg>::Output == T,
impl<T> ConditionallyNegatable for T where
T: ConditionallySelectable,
&'a T: for<'a> Neg,
<&'a T as Neg>::Output == T,
sourcefn conditional_negate(&mut self, choice: Choice)
fn conditional_negate(&mut self, choice: Choice)
Negate self
if choice == Choice(1)
; otherwise, leave it
unchanged. Read more
impl<T> FmtForward for T
impl<T> FmtForward for T
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self> where
Self: Binary,
Causes self
to use its Binary
implementation when Debug
-formatted.
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self> where
Self: Display,
Causes self
to use its Display
implementation when
Debug
-formatted. Read more
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self> where
Self: LowerExp,
Causes self
to use its LowerExp
implementation when
Debug
-formatted. Read more
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self> where
Self: LowerHex,
Causes self
to use its LowerHex
implementation when
Debug
-formatted. Read more
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self> where
Self: Octal,
Causes self
to use its Octal
implementation when Debug
-formatted.
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self> where
Self: Pointer,
Causes self
to use its Pointer
implementation when
Debug
-formatted. Read more
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self> where
Self: UpperExp,
Causes self
to use its UpperExp
implementation when
Debug
-formatted. Read more
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self> where
Self: UpperHex,
Causes self
to use its UpperHex
implementation when
Debug
-formatted. Read more
impl<T> Pipe for T where
T: ?Sized,
impl<T> Pipe for T where
T: ?Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
Pipes by value. This is generally the method you want to use. Read more
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R where
R: 'a,
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
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R where
R: 'a,
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
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R where
Self: Borrow<B>,
B: 'a + ?Sized,
R: 'a,
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
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,
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
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,
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.
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,
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. Read more
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,
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.
impl<T> Tap for T
impl<T> Tap for T
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
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
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
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
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
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
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
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
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self where
Self: Deref<Target = T>,
T: ?Sized,
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
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self where
Self: DerefMut<Target = T> + Deref,
T: ?Sized,
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
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
Calls .tap()
only in debug builds, and is erased in release builds.
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
Calls .tap_mut()
only in debug builds, and is erased in release
builds. Read more
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self where
Self: Borrow<B>,
B: ?Sized,
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. Read more
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self where
Self: BorrowMut<B>,
B: ?Sized,
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. Read more
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self where
Self: AsRef<R>,
R: ?Sized,
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. Read more
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self where
Self: AsMut<R>,
R: ?Sized,
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. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more