[go: up one dir, main page]

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 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.

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

[src]

Constant time eq

NOTE: it compare memory value.

1.0.0
[src]

This method tests for !=.

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

[src]

Constant time cmp

NOTE: it compare memory value.

1.0.0
[src]

This method tests less than (for self and other) and is used by the < operator. Read more

1.0.0
[src]

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

1.0.0
[src]

This method tests greater than (for self and other) and is used by the > operator. Read more

1.0.0
[src]

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more

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

[src]

Executes the destructor for this type. Read more