Trait subtle::ConditionallySwappable
[−]
[src]
pub trait ConditionallySwappable {
fn conditional_swap(&mut self, other: &mut Self, choice: Choice);
}A type which is conditionally swappable in constant time.
Required Methods
fn conditional_swap(&mut self, other: &mut Self, choice: Choice)
Conditionally swap self and other if choice == 1; otherwise,
reassign both unto themselves.
Note
This trait is generically implemented for any type which implements
ConditionallyAssignable + Copy, but is feature-gated on the
"generic-impls" feature, in order to allow more fast/efficient
implementations without clashing with the orphan rules.
Implementors
impl<T> ConditionallySwappable for T where
T: ConditionallyAssignable + Copy,