Struct seckey::TempKey [] [src]

pub struct TempKey<'a, T: ?Sized + 'static>(_);

Temporary Key

use seckey::{ TempKey, CmpKey };

let mut key = [8u8; 8];
let key = TempKey::from(&mut key);
assert_eq!(CmpKey::from(&*key), &[8u8; 8]);

Note

  • It will zero the value when Drop.
  • It will refuse to accept if T is 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]

[src]

Trait Implementations

impl<'a, T: ?Sized + ZeroSafe> From<&'a mut T> for TempKey<'a, T>
[src]

[src]

Performs the conversion.

impl<'a, T: ?Sized> Deref for TempKey<'a, T>
[src]

The resulting type after dereferencing.

[src]

Dereferences the value.

impl<'a, T: ?Sized> DerefMut for TempKey<'a, T>
[src]

[src]

Mutably dereferences the value.

impl<'a, T: ?Sized> Debug for TempKey<'a, T>
[src]

[src]

Formats the value using the given formatter. Read more

impl<'a, T: ?Sized> Drop for TempKey<'a, T>
[src]

[src]

Executes the destructor for this type. Read more

Auto Trait Implementations

impl<'a, T: ?Sized> Send for TempKey<'a, T> where
    T: Send

impl<'a, T: ?Sized> Sync for TempKey<'a, T> where
    T: Sync