Trait subtle::Equal [] [src]

pub trait Equal {
    fn ct_eq(&self, other: &Self) -> Mask;
}

Trait for items whose equality to another item may be tested in constant time.

Required Methods

Determine if two items are equal in constant time.

Returns

1u8 if the two items are equal, and 0u8 otherwise.

Examples

let x: u8 = 5;
let y: u8 = 13;

assert!(x.ct_eq(&y) == 0);
assert!(x.ct_eq(&5) == 1);

Implementors