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`], [`isize`] - [`u8`], [`u16`], [`u32`], [`u64`], [`u128`], [`usize`] - [`NonZeroI8`], [`NonZeroI16`], [`NonZeroI32`], [`NonZeroI64`], [`NonZeroI128`], [`NonZeroI128`] - [`NonZeroU8`], [`NonZe
| 26 | /// - `[T]` and `[T; N]` where `T` impls [`CtAssignSlice`], which the previously mentioned |
| 27 | /// types all do. |
| 28 | pub trait CtAssign<Rhs: ?Sized = Self> { |
| 29 | /// Conditionally assign `src` to `self` if `choice` is [`Choice::TRUE`]. |
| 30 | fn ct_assign(&mut self, src: &Rhs, choice: Choice); |
| 31 | } |
| 32 | |
| 33 | /// Implementing this trait enables use of the [`CtAssign`] trait for `[T]` where `T` is the |
| 34 | /// `Self` type implementing the trait, via a blanket impl. |
nothing calls this directly
no outgoing calls
no test coverage detected