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

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