[][src]Trait subtle::ConditionallySwappable

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.

Implementors

impl<T> ConditionallySwappable for T where
    T: ConditionallyAssignable + Copy
[src][]