snarkvm_console_program

Struct Field

Source
pub struct Field<E>
where E: Environment,
{ /* private fields */ }

Implementations§

Source§

impl<E> Field<E>
where E: Environment,

Source

pub fn even_square_root(&self) -> Result<Field<E>, Error>

Returns the square_root of self, where the least significant bit of the square root is zero.

Source§

impl<E> Field<E>
where E: Environment,

Source

pub const SIZE_IN_BITS: usize = <E::Field>::SIZE_IN_BITS

The field size in bits.

Source

pub const SIZE_IN_BYTES: usize = _

The field size in bytes.

Source

pub const SIZE_IN_DATA_BITS: usize = <E::Field>::SIZE_IN_DATA_BITS

The field capacity for data bits.

Source

pub const fn new(field: <E as Environment>::Field) -> Field<E>

Initializes a new field.

Source

pub fn new_domain_separator(domain: &str) -> Field<E>

Initializes a new field as a domain separator.

Source

pub fn from_u8(value: u8) -> Field<E>

Initializes a new field from a u8.

Source

pub fn from_u16(value: u16) -> Field<E>

Initializes a new field from a u16.

Source

pub fn from_u32(value: u32) -> Field<E>

Initializes a new field from a u32.

Source

pub fn from_u64(value: u64) -> Field<E>

Initializes a new field from a u64.

Source

pub fn from_u128(value: u128) -> Field<E>

Initializes a new field from a u128.

Source

pub fn half() -> Field<E>

Returns 1 * 2^{-1}.

Trait Implementations§

Source§

impl<E> Add<&Field<E>> for Field<E>
where E: Environment,

Source§

fn add(self, other: &Field<E>) -> <Field<E> as Add<&Field<E>>>::Output

Returns the sum of self and other.

Source§

type Output = Field<E>

The resulting type after applying the + operator.
Source§

impl<E> Add for Field<E>
where E: Environment,

Source§

fn add(self, other: Field<E>) -> <Field<E> as Add>::Output

Returns the sum of self and other.

Source§

type Output = Field<E>

The resulting type after applying the + operator.
Source§

impl<E> AddAssign<&Field<E>> for Field<E>
where E: Environment,

Source§

fn add_assign(&mut self, other: &Field<E>)

Adds other to self.

Source§

impl<E> AddAssign for Field<E>
where E: Environment,

Source§

fn add_assign(&mut self, other: Field<E>)

Adds other to self.

Source§

impl<E: Environment> Cast<Address<E>> for Field<E>

Source§

fn cast(&self) -> Result<Address<E>>

Casts a Field to an Address.

This operation attempts to recover the group element from the field element, and then constructs an address from the group element.

To cast arbitrary field elements to addresses, use Field::cast_lossy.

Source§

impl<E: Environment> Cast<Boolean<E>> for Field<E>

Source§

fn cast(&self) -> Result<Boolean<E>>

Casts a Field to a Boolean, if the field is zero or one.

To cast arbitrary field elements to booleans, use Field::cast_lossy.

Source§

impl<E: Environment> Cast<Field<E>> for Boolean<E>

Source§

fn cast(&self) -> Result<Field<E>>

Casts a Boolean to a Field.

Source§

impl<E: Environment, I: IntegerType> Cast<Field<E>> for Integer<E, I>

Source§

fn cast(&self) -> Result<Field<E>>

Casts an Integer to a Field.

Source§

impl<E: Environment> Cast<Field<E>> for Scalar<E>

Source§

fn cast(&self) -> Result<Field<E>>

Casts a Scalar to a Field.

Source§

impl<E: Environment> Cast<Group<E>> for Field<E>

Source§

fn cast(&self) -> Result<Group<E>>

Casts a Field to a Group.

This operation attempts to recover the group element from the field element, and returns an error if the field element is not a valid x-coordinate.

To cast arbitrary field elements to groups, use Field::cast_lossy.

Source§

impl<E: Environment, I: IntegerType> Cast<Integer<E, I>> for Field<E>

Source§

fn cast(&self) -> Result<Integer<E, I>>

Casts a Field to an Integer, if the field element is in the integer’s range.

To cast arbitrary field elements to integers, use Field::cast_lossy.

Source§

impl<E: Environment> Cast<Scalar<E>> for Field<E>

Source§

fn cast(&self) -> Result<Scalar<E>>

Casts a Field to a Scalar, if the field element is in the scalar’s range.

To cast arbitrary field elements to scalars, use Field::cast_lossy.

Source§

impl<E: Environment> Cast for Field<E>

Source§

fn cast(&self) -> Result<Field<E>>

Casts a Field to a Field.

Source§

impl<E: Environment> CastLossy<Address<E>> for Field<E>

Source§

fn cast_lossy(&self) -> Address<E>

Casts a Field to an Address.

This operation attempts to recover the group element from the given field, which is then used to construct the address. See the documentation of Field::cast_lossy on the Group type for more details.

Source§

impl<E: Environment> CastLossy<Boolean<E>> for Field<E>

Source§

fn cast_lossy(&self) -> Boolean<E>

Casts a Field to a Boolean, with lossy truncation. This operation returns the least significant bit of the field.

Source§

impl<E: Environment> CastLossy<Field<E>> for Boolean<E>

Source§

fn cast_lossy(&self) -> Field<E>

Casts a Boolean to a Field. This is safe because casting from a boolean to any other type is always lossless.

Source§

impl<E: Environment, I: IntegerType> CastLossy<Field<E>> for Integer<E, I>

Source§

fn cast_lossy(&self) -> Field<E>

Casts an Integer to a Field. This is safe because casting from an integer to a field is always lossless.

Source§

impl<E: Environment> CastLossy<Field<E>> for Scalar<E>

Source§

fn cast_lossy(&self) -> Field<E>

Casts a Scalar to a Field. This operation is always lossless.

Source§

impl<E: Environment> CastLossy<Group<E>> for Field<E>

Source§

fn cast_lossy(&self) -> Group<E>

Casts a Field to a Group.

This operation attempts to recover the group element from the given field.

If the field is a valid x-coordinate, then the group element is returned. If the field is not a valid x-coordinate, then if the field is the one element, the generator of the prime-order subgroup is returned. Otherwise, Elligator-2 is applied to the field element to recover a group element.

Source§

impl<E: Environment, I: IntegerType> CastLossy<Integer<E, I>> for Field<E>

Source§

fn cast_lossy(&self) -> Integer<E, I>

Casts a Field to an Integer, with lossy truncation. This operation truncates the field to an integer.

Source§

impl<E: Environment> CastLossy<Scalar<E>> for Field<E>

Source§

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

Casts a Field to a Scalar, with lossy truncation. This operation truncates the field to a scalar.

Source§

impl<E: Environment> CastLossy for Field<E>

Source§

fn cast_lossy(&self) -> Field<E>

Casts a Field to a Field. This is an identity cast, so it is always lossless.

Source§

impl<E> Clone for Field<E>
where E: Clone + Environment, <E as Environment>::Field: Clone,

Source§

fn clone(&self) -> Field<E>

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> Compare for Field<E>
where E: Environment,

Source§

fn is_less_than(&self, other: &Field<E>) -> <Field<E> as Compare>::Output

Returns true if self is less than other.

Source§

fn is_greater_than(&self, other: &Field<E>) -> <Field<E> as Compare>::Output

Returns true if self is greater than other.

Source§

fn is_less_than_or_equal( &self, other: &Field<E>, ) -> <Field<E> as Compare>::Output

Returns true if self is less than or equal to other.

Source§

fn is_greater_than_or_equal( &self, other: &Field<E>, ) -> <Field<E> as Compare>::Output

Returns true if self is greater than or equal to other.

Source§

type Output = Boolean<E>

Source§

impl<E> Debug for Field<E>
where E: Environment,

Source§

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

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

impl<E> Default for Field<E>
where E: Environment,

Source§

fn default() -> Field<E>

Returns the default field element.

Source§

impl<E> Deref for Field<E>
where E: Environment,

Source§

type Target = <E as Environment>::Field

The resulting type after dereferencing.
Source§

fn deref(&self) -> &<Field<E> as Deref>::Target

Dereferences the value.
Source§

impl<E> DerefMut for Field<E>
where E: Environment,

Source§

fn deref_mut(&mut self) -> &mut <Field<E> as Deref>::Target

Mutably dereferences the value.
Source§

impl<'de, E> Deserialize<'de> for Field<E>
where E: Environment,

Source§

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

Deserializes the field from a string or bytes.

Source§

impl<E> Display for Field<E>
where E: Environment,

Source§

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

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

impl<E> Distribution<Field<E>> for Standard
where E: Environment,

Source§

fn sample<R>(&self, rng: &mut R) -> Field<E>
where R: Rng + ?Sized,

Generate a random value of T, using rng as the source of randomness.
Source§

fn sample_iter<R>(self, rng: R) -> DistIter<Self, R, T>
where R: Rng, Self: Sized,

Create an iterator that generates random values of T, using rng as the source of randomness. Read more
Source§

fn map<F, S>(self, func: F) -> DistMap<Self, F, T, S>
where F: Fn(T) -> S, Self: Sized,

Create a distribution of values of ‘S’ by mapping the output of Self through the closure F Read more
Source§

impl<E> Div<&Field<E>> for Field<E>
where E: Environment,

Source§

fn div(self, other: &Field<E>) -> <Field<E> as Div<&Field<E>>>::Output

Returns the quotient of self and other.

Source§

type Output = Field<E>

The resulting type after applying the / operator.
Source§

impl<E> Div for Field<E>
where E: Environment,

Source§

fn div(self, other: Field<E>) -> <Field<E> as Div>::Output

Returns the quotient of self and other.

Source§

type Output = Field<E>

The resulting type after applying the / operator.
Source§

impl<E> DivAssign<&Field<E>> for Field<E>
where E: Environment,

Source§

fn div_assign(&mut self, other: &Field<E>)

Divides self by other.

Source§

impl<E> DivAssign for Field<E>
where E: Environment,

Source§

fn div_assign(&mut self, other: Field<E>)

Divides self by other.

Source§

impl<E> Double for Field<E>
where E: Environment,

Source§

fn double(&self) -> <Field<E> as Double>::Output

Returns the double of self.

Source§

type Output = Field<E>

Source§

impl<E> Equal for Field<E>
where E: Environment,

Source§

fn is_equal(&self, other: &Field<E>) -> <Field<E> as Equal>::Output

Returns true if self and other are equal.

Source§

fn is_not_equal(&self, other: &Field<E>) -> <Field<E> as Equal>::Output

Returns true if self and other are not equal.

Source§

type Output = Boolean<E>

Source§

impl<E> FromBits for Field<E>
where E: Environment,

Source§

fn from_bits_le(bits_le: &[bool]) -> Result<Field<E>, Error>

Initializes a new field from a list of little-endian bits.

  • If bits_le is longer than E::Field::size_in_bits(), the excess bits are enforced to be 0s.
  • If bits_le is shorter than E::Field::size_in_bits(), it is padded with 0s up to field size.
Source§

fn from_bits_be(bits_be: &[bool]) -> Result<Field<E>, Error>

Initializes a new field from a list of big-endian bits without leading zeros.

Source§

impl<E> FromBytes for Field<E>
where E: Environment,

Source§

fn read_le<R>(reader: R) -> Result<Field<E>, Error>
where R: Read,

Reads the field from a buffer.

Source§

fn from_bytes_le(bytes: &[u8]) -> Result<Self, Error>
where Self: Sized,

Returns Self from a byte array in little-endian order.
Source§

impl<E> FromStr for Field<E>
where E: Environment,

Source§

fn from_str(string: &str) -> Result<Field<E>, Error>

Parses a string into a field.

Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

impl<E> Hash for Field<E>
where E: Hash + Environment, <E as Environment>::Field: Hash,

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<E> Inverse for Field<E>
where E: Environment,

Source§

fn inverse(&self) -> Result<<Field<E> as Inverse>::Output, Error>

Returns the inverse of self.

Source§

type Output = Field<E>

Source§

impl<E> Mul<&Field<E>> for Field<E>
where E: Environment,

Source§

fn mul(self, other: &Field<E>) -> <Field<E> as Mul<&Field<E>>>::Output

Returns the product of self and other.

Source§

type Output = Field<E>

The resulting type after applying the * operator.
Source§

impl<E> Mul for Field<E>
where E: Environment,

Source§

fn mul(self, other: Field<E>) -> <Field<E> as Mul>::Output

Returns the product of self and other.

Source§

type Output = Field<E>

The resulting type after applying the * operator.
Source§

impl<E> MulAssign<&Field<E>> for Field<E>
where E: Environment,

Source§

fn mul_assign(&mut self, other: &Field<E>)

Multiplies self by other.

Source§

impl<E> MulAssign for Field<E>
where E: Environment,

Source§

fn mul_assign(&mut self, other: Field<E>)

Multiplies self by other.

Source§

impl<E> Neg for Field<E>
where E: Environment,

Source§

fn neg(self) -> <Field<E> as Neg>::Output

Returns the negation of self.

Source§

type Output = Field<E>

The resulting type after applying the - operator.
Source§

impl<E> One for Field<E>
where E: Environment,

Source§

fn one() -> Field<E>

Returns the 1 element of the field.

Source§

fn is_one(&self) -> bool

Returns true if the element is one.

Source§

fn set_one(&mut self)

Sets self to the multiplicative identity element of Self, 1.
Source§

impl<E> Ord for Field<E>
where E: Environment,

Source§

fn cmp(&self, other: &Field<E>) -> Ordering

Returns the lexicographic ordering of self and other.

1.21.0 · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

impl<E> Parser for Field<E>
where E: Environment,

Source§

fn parse(string: &str) -> Result<(&str, Field<E>), Err<VerboseError<&str>>>

Parses a string into a field circuit.

Source§

impl<E> PartialEq for Field<E>

Source§

fn eq(&self, other: &Field<E>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<E> PartialOrd for Field<E>
where E: Environment,

Source§

fn partial_cmp(&self, other: &Field<E>) -> Option<Ordering>

Returns the lexicographic ordering of self and other.

1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<E> Pow<&Field<E>> for Field<E>
where E: Environment,

Source§

fn pow(self, other: &Field<E>) -> <Field<E> as Pow<&Field<E>>>::Output

Returns the power of self to the power of other.

Source§

type Output = Field<E>

The result after applying the operator.
Source§

impl<E> Pow<Field<E>> for Field<E>
where E: Environment,

Source§

fn pow(self, other: Field<E>) -> <Field<E> as Pow<Field<E>>>::Output

Returns the power of self to the power of other.

Source§

type Output = Field<E>

The result after applying the operator.
Source§

impl<'a, E> Product<&'a Field<E>> for Field<E>
where E: Environment,

Source§

fn product<I>(iter: I) -> Field<E>
where I: Iterator<Item = &'a Field<E>>,

Returns the product of self and other.

Source§

impl<E> Product for Field<E>
where E: Environment,

Source§

fn product<I>(iter: I) -> Field<E>
where I: Iterator<Item = Field<E>>,

Returns the product of self and other.

Source§

impl<E> Serialize for Field<E>
where E: Environment,

Source§

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

Serializes the field into a string or as bytes.

Source§

impl<E> SizeInBits for Field<E>
where E: Environment,

Source§

fn size_in_bits() -> usize

Returns the field size in bits.

Source§

impl<E> SizeInBytes for Field<E>
where E: Environment,

Source§

fn size_in_bytes() -> usize

Returns the field size in bytes.

Source§

impl<E> SizeInDataBits for Field<E>
where E: Environment,

Source§

fn size_in_data_bits() -> usize

Returns the field capacity for data bits.

Source§

impl<E> Square for Field<E>
where E: Environment,

Source§

fn square(&self) -> <Field<E> as Square>::Output

Returns the square of self.

Source§

type Output = Field<E>

Source§

impl<E> SquareRoot for Field<E>
where E: Environment,

Source§

fn square_root(&self) -> Result<<Field<E> as SquareRoot>::Output, Error>

Returns the square_root of self. If there are two square roots, the bitwise lesser one is returned.

Source§

type Output = Field<E>

Source§

impl<E> Sub<&Field<E>> for Field<E>
where E: Environment,

Source§

fn sub(self, other: &Field<E>) -> <Field<E> as Sub<&Field<E>>>::Output

Returns the difference of self and other.

Source§

type Output = Field<E>

The resulting type after applying the - operator.
Source§

impl<E> Sub for Field<E>
where E: Environment,

Source§

fn sub(self, other: Field<E>) -> <Field<E> as Sub>::Output

Returns the difference of self and other.

Source§

type Output = Field<E>

The resulting type after applying the - operator.
Source§

impl<E> SubAssign<&Field<E>> for Field<E>
where E: Environment,

Source§

fn sub_assign(&mut self, other: &Field<E>)

Subtracts other from self.

Source§

impl<E> SubAssign for Field<E>
where E: Environment,

Source§

fn sub_assign(&mut self, other: Field<E>)

Subtracts other from self.

Source§

impl<'a, E> Sum<&'a Field<E>> for Field<E>
where E: Environment,

Source§

fn sum<I>(iter: I) -> Field<E>
where I: Iterator<Item = &'a Field<E>>,

Returns the sum of self and other.

Source§

impl<E> Sum for Field<E>
where E: Environment,

Source§

fn sum<I>(iter: I) -> Field<E>
where I: Iterator<Item = Field<E>>,

Returns the sum of self and other.

Source§

impl<E> Ternary for Field<E>
where E: Environment,

Source§

fn ternary( condition: &<Field<E> as Ternary>::Boolean, first: &Field<E>, second: &Field<E>, ) -> <Field<E> as Ternary>::Output

Returns first if condition is true, otherwise returns second.

Source§

type Boolean = Boolean<E>

Source§

type Output = Field<E>

Source§

impl<E> ToBits for Field<E>
where E: Environment,

Source§

fn write_bits_le(&self, vec: &mut Vec<bool>)

Outputs the little-endian bit representation of self without trailing zeros.

Source§

fn write_bits_be(&self, vec: &mut Vec<bool>)

Outputs the big-endian bit representation of self without leading zeros.

Source§

fn to_bits_le(&self) -> Vec<bool>

Returns self as a boolean array in little-endian order.
Source§

fn to_bits_be(&self) -> Vec<bool>

Returns self as a boolean array in big-endian order.
Source§

fn num_bits() -> Option<usize>

An optional indication of how many bits an object can be represented with.
Source§

impl<E> ToBytes for Field<E>
where E: Environment,

Source§

fn write_le<W>(&self, writer: W) -> Result<(), Error>
where W: Write,

Writes the field to a buffer.

Source§

fn to_bytes_le(&self) -> Result<Vec<u8>, Error>
where Self: Sized,

Returns self as a byte array in little-endian order.
Source§

impl<E> TypeName for Field<E>
where E: Environment,

Source§

fn type_name() -> &'static str

Returns the type name as a string.

Source§

impl<E> Zero for Field<E>
where E: Environment,

Source§

fn zero() -> Field<E>

Returns the 0 element of the field.

Source§

fn is_zero(&self) -> bool

Returns true if the element is zero.

Source§

fn set_zero(&mut self)

Sets self to the additive identity element of Self, 0.
Source§

impl<E> Zeroize for Field<E>
where E: Environment,

Source§

fn zeroize(&mut self)

Zero out this object from memory using Rust intrinsics which ensure the zeroization operation is not “optimized away” by the compiler.
Source§

impl<E> Copy for Field<E>
where E: Copy + Environment, <E as Environment>::Field: Copy,

Source§

impl<E> Eq for Field<E>
where E: Eq + Environment, <E as Environment>::Field: Eq,

Source§

impl<E> FieldTrait for Field<E>
where E: Environment,

Source§

impl<E> StructuralPartialEq for Field<E>
where E: Environment,

Auto Trait Implementations§

§

impl<E> Freeze for Field<E>
where <E as Environment>::Field: Freeze,

§

impl<E> RefUnwindSafe for Field<E>

§

impl<E> Send for Field<E>

§

impl<E> Sync for Field<E>

§

impl<E> Unpin for Field<E>
where <E as Environment>::Field: Unpin,

§

impl<E> UnwindSafe for Field<E>
where <E as Environment>::Field: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

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

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<'de, T> DeserializeExt<'de> for T

Source§

fn take_from_value<D>( value: &mut Value, field: &str, ) -> Result<T, <D as Deserializer<'de>>::Error>
where D: Deserializer<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize = _

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

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

impl<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToSmolStr for T
where T: Display + ?Sized,

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> Uniform for T

Source§

fn rand<R>(rng: &mut R) -> T
where R: Rng + ?Sized,

Samples a random value from a uniform distribution.
Source§

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

Source§

fn vzip(self) -> V

Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,