pub trait CtAssign<Rhs: ?Sized = Self> {
// Required method
fn ct_assign(&mut self, src: &Rhs, choice: Choice);
}Expand description
Constant-time conditional assignment: assign a given value to another based on a Choice.
This crate provides built-in implementations for the following types:
i8,i16,i32,i64,i128,isizeu8,u16,u32,u64,u128,usizeNonZeroI8,NonZeroI16,NonZeroI32,NonZeroI64,NonZeroI128NonZeroU8,NonZeroU16,NonZeroU32,NonZeroU64,NonZeroU128cmp::OrderingChoice[T]and[T; N]whereTimplsCtAssignSlice, which the previously mentioned types all do.
Required Methods§
Sourcefn ct_assign(&mut self, src: &Rhs, choice: Choice)
fn ct_assign(&mut self, src: &Rhs, choice: Choice)
Conditionally assign src to self if choice is Choice::TRUE.