Struct seckey::TempKey
[−]
[src]
pub struct TempKey<'a, T: ?Sized + 'static>(_);
Temporary Key
use seckey::TempKey; let mut key = [8u8; 8]; let key = TempKey::from(&mut key); assert_eq!(key, [8u8; 8]); assert_ne!(key, [1u8; 8]);
Note
- It will zero the value when
Drop. - It will refuse to accept if
Tis reference or pointer, to avoid causing null pointer. - It is a reference, to avoid it from being affected by stack copy (return value).
Methods
impl<'a, T: ?Sized> TempKey<'a, T>[src]
unsafe fn unsafe_from(t: &'a mut T) -> TempKey<'a, T>[src]
Trait Implementations
impl<'a, T: ?Sized + ZeroSafe> From<&'a mut T> for TempKey<'a, T>[src]
impl<'a, T: ?Sized> Deref for TempKey<'a, T>[src]
type Target = T
The resulting type after dereferencing.
fn deref(&self) -> &T[src]
Dereferences the value.
impl<'a, T: ?Sized> DerefMut for TempKey<'a, T>[src]
impl<'a, T: ?Sized> Debug for TempKey<'a, T>[src]
impl<'a, T: ?Sized> PartialEq<T> for TempKey<'a, T>[src]
fn eq(&self, rhs: &T) -> bool[src]
Constant time eq
NOTE: it compare memory value.
fn ne(&self, other: &Rhs) -> bool1.0.0[src]
This method tests for !=.
impl<'a, T: ?Sized> PartialOrd<T> for TempKey<'a, T>[src]
fn partial_cmp(&self, rhs: &T) -> Option<Ordering>[src]
Constant time cmp
NOTE: it compare memory value.
fn lt(&self, other: &Rhs) -> bool1.0.0[src]
This method tests less than (for self and other) and is used by the < operator. Read more
fn le(&self, other: &Rhs) -> bool1.0.0[src]
This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
fn gt(&self, other: &Rhs) -> bool1.0.0[src]
This method tests greater than (for self and other) and is used by the > operator. Read more
fn ge(&self, other: &Rhs) -> bool1.0.0[src]
This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more