pub struct SecretScalar<E: Curve>(/* private fields */);
Expand description

Scalar representing sensitive information (like secret key)

Secret scalar should be treated with an extra care. You shouldn’t do any branching (e.g. Eq, Ord) on the secret to avoid timing side-channel attacks, so it implements only constant time traits (like ConstantTimeEq).

Also, when alloc feature is enabled, we enforce extra measures:

  • Secret scalar leaves no trace in RAM after it’s dropped
    Memory is zeroized after use
  • All clones of secret scalar refer to the same region in the memory
    I.e. there will always be only one instance of the scalar in the memory no matter how many clones you make

All these guarantees can be bypassed by calling .as_ref() and obtaining &Scalar<E> that is not protected from timing attacks, leaving traces in the memory, etc.

Implementations§

source§

impl<E: Curve> SecretScalar<E>

source

pub fn new(scalar: &mut Scalar<E>) -> Self

Constructs a new secret scalar

It takes original scalar by mutable reference instead of taking by value to avoid leaving copies of scalar on stack. Scalar behind the reference will be zeroized after function returned.

source§

impl<E: Curve> SecretScalar<E>

source

pub fn zero() -> Self

Returns scalar $S = 0$

source

pub fn one() -> Self

Returns scalar $S = 1$

source

pub fn invert(&self) -> Option<Self>

Returns scalar inverse

source

pub fn random<R: RngCore + CryptoRng>(rng: &mut R) -> Self

Generates random secret scalar

source

pub fn from_be_bytes(bytes: &[u8]) -> Result<Self, InvalidScalar>

Decodes scalar from its bytes representation in big-endian order

source

pub fn from_le_bytes(bytes: &[u8]) -> Result<Self, InvalidScalar>

Decodes scalar from its bytes representation in little-endian order

Trait Implementations§

source§

impl<E: Curve> Add<&NonZero<Scalar<E>>> for &SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &NonZero<Scalar<E>>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Curve> Add<&NonZero<Scalar<E>>> for SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &NonZero<Scalar<E>>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Curve> Add<&Scalar<E>> for &SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Scalar<E>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Curve> Add<&Scalar<E>> for SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &Scalar<E>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Curve> Add<&SecretScalar<E>> for &NonZero<Scalar<E>>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Curve> Add<&SecretScalar<E>> for &Scalar<E>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Curve> Add<&SecretScalar<E>> for NonZero<Scalar<E>>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Curve> Add<&SecretScalar<E>> for Scalar<E>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Curve> Add<NonZero<Scalar<E>>> for &SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, rhs: NonZero<Scalar<E>>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Curve> Add<NonZero<Scalar<E>>> for SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, rhs: NonZero<Scalar<E>>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Curve> Add<Scalar<E>> for &SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Scalar<E>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Curve> Add<Scalar<E>> for SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, rhs: Scalar<E>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Curve> Add<SecretScalar<E>> for &NonZero<Scalar<E>>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, rhs: SecretScalar<E>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Curve> Add<SecretScalar<E>> for &Scalar<E>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, rhs: SecretScalar<E>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Curve> Add<SecretScalar<E>> for NonZero<Scalar<E>>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, rhs: SecretScalar<E>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Curve> Add<SecretScalar<E>> for Scalar<E>

§

type Output = Scalar<E>

The resulting type after applying the + operator.
source§

fn add(self, rhs: SecretScalar<E>) -> Self::Output

Performs the + operation. Read more
source§

impl<E: Curve> AsRef<Scalar<E>> for SecretScalar<E>

source§

fn as_ref(&self) -> &Scalar<E>

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<E: Curve> Clone for SecretScalar<E>

source§

fn clone(&self) -> Self

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

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

Performs copy-assignment from source. Read more
source§

impl<E: Curve> ConstantTimeEq for SecretScalar<E>

source§

fn ct_eq(&self, other: &Self) -> Choice

Determine if two items are equal. Read more
source§

fn ct_ne(&self, other: &Self) -> Choice

Determine if two items are NOT equal. Read more
source§

impl<E: Curve> Debug for SecretScalar<E>

source§

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

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

impl<'de, E: Curve> Deserialize<'de> for SecretScalar<E>

Available on crate feature serde only.
source§

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

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

impl<'de, E: Curve> DeserializeAs<'de, SecretScalar<E>> for Compact

Available on crate feature serde only.
source§

fn deserialize_as<D>(deserializer: D) -> Result<SecretScalar<E>, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer.
source§

impl<E: Curve> Mul<&Generator<E>> for &SecretScalar<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Generator<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&Generator<E>> for SecretScalar<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Generator<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&NonZero<Point<E>>> for &SecretScalar<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &NonZero<Point<E>>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&NonZero<Point<E>>> for SecretScalar<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &NonZero<Point<E>>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&NonZero<Scalar<E>>> for &SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &NonZero<Scalar<E>>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&NonZero<Scalar<E>>> for SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &NonZero<Scalar<E>>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&Point<E>> for &SecretScalar<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Point<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&Point<E>> for SecretScalar<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Point<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&Scalar<E>> for &SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Scalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&Scalar<E>> for SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &Scalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&SecretScalar<E>> for &Generator<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&SecretScalar<E>> for &NonZero<Point<E>>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&SecretScalar<E>> for &NonZero<Scalar<E>>

§

type Output = Scalar<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&SecretScalar<E>> for &Point<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&SecretScalar<E>> for &Scalar<E>

§

type Output = Scalar<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&SecretScalar<E>> for Generator<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&SecretScalar<E>> for NonZero<Point<E>>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&SecretScalar<E>> for NonZero<Scalar<E>>

§

type Output = Scalar<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&SecretScalar<E>> for Point<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<&SecretScalar<E>> for Scalar<E>

§

type Output = Scalar<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<Generator<E>> for &SecretScalar<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Generator<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<Generator<E>> for SecretScalar<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Generator<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<NonZero<Point<E>>> for &SecretScalar<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: NonZero<Point<E>>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<NonZero<Point<E>>> for SecretScalar<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: NonZero<Point<E>>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<NonZero<Scalar<E>>> for &SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: NonZero<Scalar<E>>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<NonZero<Scalar<E>>> for SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: NonZero<Scalar<E>>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<Point<E>> for &SecretScalar<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Point<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<Point<E>> for SecretScalar<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Point<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<Scalar<E>> for &SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Scalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<Scalar<E>> for SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: Scalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<SecretScalar<E>> for &Generator<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<SecretScalar<E>> for &NonZero<Point<E>>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<SecretScalar<E>> for &NonZero<Scalar<E>>

§

type Output = Scalar<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<SecretScalar<E>> for &Point<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<SecretScalar<E>> for &Scalar<E>

§

type Output = Scalar<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<SecretScalar<E>> for Generator<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<SecretScalar<E>> for NonZero<Point<E>>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<SecretScalar<E>> for NonZero<Scalar<E>>

§

type Output = Scalar<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<SecretScalar<E>> for Point<E>

§

type Output = Point<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<E: Curve> Mul<SecretScalar<E>> for Scalar<E>

§

type Output = Scalar<E>

The resulting type after applying the * operator.
source§

fn mul(self, rhs: SecretScalar<E>) -> Self::Output

Performs the * operation. Read more
source§

impl<'s, E: Curve> Product<&'s SecretScalar<E>> for Scalar<E>

source§

fn product<I: Iterator<Item = &'s SecretScalar<E>>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by multiplying the items.
source§

impl<E: Curve> Product<SecretScalar<E>> for Scalar<E>

source§

fn product<I: Iterator<Item = SecretScalar<E>>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by multiplying the items.
source§

impl<E: Curve> Samplable for SecretScalar<E>

source§

fn random<R: RngCore>(rng: &mut R) -> Self

source§

impl<E: Curve> Serialize for SecretScalar<E>

Available on crate feature serde only.
source§

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

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

impl<E: Curve> SerializeAs<SecretScalar<E>> for Compact

Available on crate feature serde only.
source§

fn serialize_as<S>( source: &SecretScalar<E>, serializer: S ) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer.
source§

impl<E: Curve> Sub<&NonZero<Scalar<E>>> for &SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &NonZero<Scalar<E>>) -> Self::Output

Performs the - operation. Read more
source§

impl<E: Curve> Sub<&NonZero<Scalar<E>>> for SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &NonZero<Scalar<E>>) -> Self::Output

Performs the - operation. Read more
source§

impl<E: Curve> Sub<&Scalar<E>> for &SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Scalar<E>) -> Self::Output

Performs the - operation. Read more
source§

impl<E: Curve> Sub<&Scalar<E>> for SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &Scalar<E>) -> Self::Output

Performs the - operation. Read more
source§

impl<E: Curve> Sub<&SecretScalar<E>> for &NonZero<Scalar<E>>

§

type Output = Scalar<E>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the - operation. Read more
source§

impl<E: Curve> Sub<&SecretScalar<E>> for &Scalar<E>

§

type Output = Scalar<E>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the - operation. Read more
source§

impl<E: Curve> Sub<&SecretScalar<E>> for NonZero<Scalar<E>>

§

type Output = Scalar<E>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the - operation. Read more
source§

impl<E: Curve> Sub<&SecretScalar<E>> for Scalar<E>

§

type Output = Scalar<E>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: &SecretScalar<E>) -> Self::Output

Performs the - operation. Read more
source§

impl<E: Curve> Sub<NonZero<Scalar<E>>> for &SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: NonZero<Scalar<E>>) -> Self::Output

Performs the - operation. Read more
source§

impl<E: Curve> Sub<NonZero<Scalar<E>>> for SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: NonZero<Scalar<E>>) -> Self::Output

Performs the - operation. Read more
source§

impl<E: Curve> Sub<Scalar<E>> for &SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Scalar<E>) -> Self::Output

Performs the - operation. Read more
source§

impl<E: Curve> Sub<Scalar<E>> for SecretScalar<E>

§

type Output = Scalar<E>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: Scalar<E>) -> Self::Output

Performs the - operation. Read more
source§

impl<E: Curve> Sub<SecretScalar<E>> for &NonZero<Scalar<E>>

§

type Output = Scalar<E>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: SecretScalar<E>) -> Self::Output

Performs the - operation. Read more
source§

impl<E: Curve> Sub<SecretScalar<E>> for &Scalar<E>

§

type Output = Scalar<E>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: SecretScalar<E>) -> Self::Output

Performs the - operation. Read more
source§

impl<E: Curve> Sub<SecretScalar<E>> for NonZero<Scalar<E>>

§

type Output = Scalar<E>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: SecretScalar<E>) -> Self::Output

Performs the - operation. Read more
source§

impl<E: Curve> Sub<SecretScalar<E>> for Scalar<E>

§

type Output = Scalar<E>

The resulting type after applying the - operator.
source§

fn sub(self, rhs: SecretScalar<E>) -> Self::Output

Performs the - operation. Read more
source§

impl<'s, E: Curve> Sum<&'s SecretScalar<E>> for Scalar<E>

source§

fn sum<I: Iterator<Item = &'s SecretScalar<E>>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by “summing up” the items.
source§

impl<E: Curve> Sum<SecretScalar<E>> for Scalar<E>

source§

fn sum<I: Iterator<Item = SecretScalar<E>>>(iter: I) -> Self

Method which takes an iterator and generates Self from the elements by “summing up” the items.

Auto Trait Implementations§

§

impl<E> RefUnwindSafe for SecretScalar<E>
where <E as Curve>::Scalar: RefUnwindSafe,

§

impl<E> Send for SecretScalar<E>

§

impl<E> Sync for SecretScalar<E>

§

impl<E> Unpin for SecretScalar<E>

§

impl<E> UnwindSafe for SecretScalar<E>
where <E as Curve>::Scalar: RefUnwindSafe,

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

source§

fn from(t: T) -> T

Returns the argument unchanged.

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

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

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, U> TryFrom<U> for T
where U: Into<T>,

§

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>,

§

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<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,