TpOrd

Trait TpOrd 

Source
pub trait TpOrd<Rhs = Self>
where Rhs: ?Sized,
{ // Required methods fn tp_lt(&self, other: &Rhs) -> TpBool; fn tp_lt_eq(&self, other: &Rhs) -> TpBool; fn tp_gt(&self, other: &Rhs) -> TpBool; fn tp_gt_eq(&self, other: &Rhs) -> TpBool; }
Expand description

A trait for performing comparisons on types with timing leak protection.

Important: implementations of this trait are only required to protect inputs that are already a timing-protected type. For example, a.tp_lt(&b) is allowed to leak a if a is a u32, instead of a timing-protected type like TpU32.

Ideally, this trait will be removed in the future if/when Rust allows overloading of the <, >, <=, and >= operators.

Required Methods§

Source

fn tp_lt(&self, other: &Rhs) -> TpBool

Compute self < other without leaking the result. Important: if either input is not a timing-protected type, this operation might leak the value of that type. To prevent timing leaks, protect values before performing any operations on them.

Source

fn tp_lt_eq(&self, other: &Rhs) -> TpBool

Compute self <= other without leaking the result. Important: if either input is not a timing-protected type, this operation might leak the value of that type. To prevent timing leaks, protect values before performing any operations on them.

Source

fn tp_gt(&self, other: &Rhs) -> TpBool

Compute self > other without leaking the result. Important: if either input is not a timing-protected type, this operation might leak the value of that type. To prevent timing leaks, protect values before performing any operations on them.

Source

fn tp_gt_eq(&self, other: &Rhs) -> TpBool

Compute self >= other without leaking the result. Important: if either input is not a timing-protected type, this operation might leak the value of that type. To prevent timing leaks, protect values before performing any operations on them.

Implementations on Foreign Types§

Source§

impl TpOrd<TpI8> for i8

Source§

fn tp_lt(&self, other: &TpI8) -> TpBool

Source§

fn tp_gt(&self, other: &TpI8) -> TpBool

Source§

fn tp_lt_eq(&self, other: &TpI8) -> TpBool

Source§

fn tp_gt_eq(&self, other: &TpI8) -> TpBool

Source§

impl TpOrd<TpI16> for i16

Source§

fn tp_lt(&self, other: &TpI16) -> TpBool

Source§

fn tp_gt(&self, other: &TpI16) -> TpBool

Source§

fn tp_lt_eq(&self, other: &TpI16) -> TpBool

Source§

fn tp_gt_eq(&self, other: &TpI16) -> TpBool

Source§

impl TpOrd<TpI32> for i32

Source§

fn tp_lt(&self, other: &TpI32) -> TpBool

Source§

fn tp_gt(&self, other: &TpI32) -> TpBool

Source§

fn tp_lt_eq(&self, other: &TpI32) -> TpBool

Source§

fn tp_gt_eq(&self, other: &TpI32) -> TpBool

Source§

impl TpOrd<TpI64> for i64

Source§

fn tp_lt(&self, other: &TpI64) -> TpBool

Source§

fn tp_gt(&self, other: &TpI64) -> TpBool

Source§

fn tp_lt_eq(&self, other: &TpI64) -> TpBool

Source§

fn tp_gt_eq(&self, other: &TpI64) -> TpBool

Source§

impl TpOrd<TpU8> for u8

Source§

fn tp_lt(&self, other: &TpU8) -> TpBool

Source§

fn tp_gt(&self, other: &TpU8) -> TpBool

Source§

fn tp_lt_eq(&self, other: &TpU8) -> TpBool

Source§

fn tp_gt_eq(&self, other: &TpU8) -> TpBool

Source§

impl TpOrd<TpU16> for u16

Source§

fn tp_lt(&self, other: &TpU16) -> TpBool

Source§

fn tp_gt(&self, other: &TpU16) -> TpBool

Source§

fn tp_lt_eq(&self, other: &TpU16) -> TpBool

Source§

fn tp_gt_eq(&self, other: &TpU16) -> TpBool

Source§

impl TpOrd<TpU32> for u32

Source§

fn tp_lt(&self, other: &TpU32) -> TpBool

Source§

fn tp_gt(&self, other: &TpU32) -> TpBool

Source§

fn tp_lt_eq(&self, other: &TpU32) -> TpBool

Source§

fn tp_gt_eq(&self, other: &TpU32) -> TpBool

Source§

impl TpOrd<TpU64> for u64

Source§

fn tp_lt(&self, other: &TpU64) -> TpBool

Source§

fn tp_gt(&self, other: &TpU64) -> TpBool

Source§

fn tp_lt_eq(&self, other: &TpU64) -> TpBool

Source§

fn tp_gt_eq(&self, other: &TpU64) -> TpBool

Implementors§