Odd

Struct Odd 

Source
pub struct Odd<T>(/* private fields */);
Expand description

Wrapper type for odd integers.

These are frequently used in cryptography, e.g. as a modulus.

Implementations§

Source§

impl<T> Odd<T>

Source

pub fn new(n: T) -> CtOption<Self>
where T: Integer,

Create a new odd integer.

Source

pub const fn as_ref(&self) -> &T

Provides access to the contents of Odd in a const context.

Source

pub const fn as_nz_ref(&self) -> &NonZero<T>

All odd integers are definitionally non-zero, so we can also obtain a reference to NonZero.

Source

pub fn get(self) -> T

Returns the inner value.

Source§

impl<const LIMBS: usize> Odd<Uint<LIMBS>>

Source

pub const fn from_be_hex(hex: &str) -> Self

Create a new Odd<Uint<LIMBS>> from the provided big endian hex string.

Panics if the hex is malformed or not zero-padded accordingly for the size, or if the value is even.

Source

pub const fn from_le_hex(hex: &str) -> Self

Create a new Odd<Uint<LIMBS>> from the provided little endian hex string.

Panics if the hex is malformed or not zero-padded accordingly for the size, or if the value is even.

Source§

impl<const SAT_LIMBS: usize, const UNSAT_LIMBS: usize> Odd<Uint<SAT_LIMBS>>
where Self: PrecomputeInverter<Inverter = SafeGcdInverter<SAT_LIMBS, UNSAT_LIMBS>>,

Source

pub const fn gcd_vartime(&self, rhs: &Uint<SAT_LIMBS>) -> Uint<SAT_LIMBS>

Compute the greatest common divisor (GCD) of this number and another.

Runs in variable time with respect to rhs.

Trait Implementations§

Source§

impl<T> AsRef<[Limb]> for Odd<T>
where T: AsRef<[Limb]>,

Source§

fn as_ref(&self) -> &[Limb]

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

impl<T> AsRef<NonZero<T>> for Odd<T>

Source§

fn as_ref(&self) -> &NonZero<T>

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

impl<T> AsRef<T> for Odd<T>

Source§

fn as_ref(&self) -> &T

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

impl<T> Binary for Odd<T>
where T: Binary,

Source§

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

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

impl<T: Clone> Clone for Odd<T>

Source§

fn clone(&self) -> Odd<T>

Returns a duplicate 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<T> ConditionallySelectable for Odd<T>

Source§

fn conditional_select(a: &Self, b: &Self, choice: Choice) -> Self

Select a or b according to choice. Read more
Source§

fn conditional_assign(&mut self, other: &Self, choice: Choice)

Conditionally assign other to self, according to choice. Read more
Source§

fn conditional_swap(a: &mut Self, b: &mut Self, choice: Choice)

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves. Read more
Source§

impl<T> ConstantTimeEq for Odd<T>
where T: ConstantTimeEq,

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<T: Debug> Debug for Odd<T>

Source§

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

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

impl<T: Default> Default for Odd<T>

Source§

fn default() -> Odd<T>

Returns the “default value” for a type. Read more
Source§

impl<T> Deref for Odd<T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &T

Dereferences the value.
Source§

impl<T> Display for Odd<T>
where T: Display,

Source§

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

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

impl<const SAT_LIMBS: usize, const UNSAT_LIMBS: usize> Gcd<Uint<SAT_LIMBS>> for Odd<Uint<SAT_LIMBS>>
where Odd<Self>: PrecomputeInverter<Inverter = SafeGcdInverter<SAT_LIMBS, UNSAT_LIMBS>>,

Source§

type Output = Uint<SAT_LIMBS>

Output type.
Source§

fn gcd(&self, rhs: &Uint<SAT_LIMBS>) -> Uint<SAT_LIMBS>

Compute the greatest common divisor of self and rhs.
Source§

fn gcd_vartime(&self, rhs: &Uint<SAT_LIMBS>) -> Self::Output

Compute the greatest common divisor of self and rhs in variable time.
Source§

impl<T: Hash> Hash for Odd<T>

Source§

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

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<T> LowerHex for Odd<T>
where T: LowerHex,

Source§

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

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

impl<T> Octal for Odd<T>
where T: Octal,

Source§

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

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

impl<T: Ord> Ord for Odd<T>

Source§

fn cmp(&self, other: &Odd<T>) -> Ordering

This method returns an Ordering between self and other. Read more
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<const LIMBS: usize> PartialEq<Odd<Uint<LIMBS>>> for Uint<LIMBS>

Source§

fn eq(&self, other: &Odd<Uint<LIMBS>>) -> 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<T: PartialEq> PartialEq for Odd<T>

Source§

fn eq(&self, other: &Odd<T>) -> 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<const LIMBS: usize> PartialOrd<Odd<Uint<LIMBS>>> for Uint<LIMBS>

Source§

fn partial_cmp(&self, other: &Odd<Uint<LIMBS>>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
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<T: PartialOrd> PartialOrd for Odd<T>

Source§

fn partial_cmp(&self, other: &Odd<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
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 PrecomputeInverter for Odd<U64>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U128>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U704>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U768>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U832>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U896>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U960>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U1024>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U1280>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U1536>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U1792>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U2048>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U192>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U3072>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U3584>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U4096>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U4224>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U4352>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U6144>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U8192>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U16384>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U32768>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U256>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U320>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U384>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U448>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U512>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U576>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl PrecomputeInverter for Odd<U640>

Precompute a Bernstein-Yang inverter using self as the modulus.

Source§

type Inverter = SafeGcdInverter<{ nlimbs!($bits) }, { safegcd_nlimbs!($bits as usize) }>

Inverter type for integers of this size.
Source§

type Output = Uint<{ nlimbs!($bits) }>

Output produced by the inverter.
Source§

fn precompute_inverter(&self) -> Self::Inverter

Obtain a precomputed inverter for &self as the modulus, using Self::one() as an adjusting parameter. Read more
Source§

impl<T> UpperHex for Odd<T>
where T: UpperHex,

Source§

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

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

impl<T: Copy> Copy for Odd<T>

Source§

impl<T: Eq> Eq for Odd<T>

Source§

impl<T> StructuralPartialEq for Odd<T>

Auto Trait Implementations§

§

impl<T> Freeze for Odd<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Odd<T>
where T: RefUnwindSafe,

§

impl<T> Send for Odd<T>
where T: Send,

§

impl<T> Sync for Odd<T>
where T: Sync,

§

impl<T> Unpin for Odd<T>
where T: Unpin,

§

impl<T> UnwindSafe for Odd<T>
where T: 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, dest: *mut u8)

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

impl<T> ConstantTimeSelect for T

Source§

fn ct_select(a: &T, b: &T, choice: Choice) -> T

Select a or b according to choice. Read more
Source§

fn ct_assign(&mut self, other: &T, choice: Choice)

Conditionally assign other to self, according to choice.
Source§

fn ct_swap(a: &mut T, b: &mut T, choice: Choice)

Conditionally swap self and other if choice == 1; otherwise, reassign both unto themselves.
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<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> 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> ToString for T
where T: Display + ?Sized,

Source§

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.

Layout§

Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.