Struct seckey::SecKey
[−]
[src]
pub struct SecKey<T> { /* fields omitted */ }
Methods
impl<T> SecKey<T> where T: Sized
[src]
fn new(t: T) -> Result<SecKey<T>, T>
use seckey::SecKey; let k = SecKey::new([1]).unwrap(); assert_eq!([1], *k.read());
unsafe fn from_raw(t: *const T) -> Option<SecKey<T>>
use seckey::SecKey; let mut v = [1]; let k = unsafe { SecKey::from_raw(&v).unwrap() }; assert_eq!([1], v); assert_eq!([1], *k.read());
impl<T> SecKey<T>
[src]
fn read(&self) -> SecReadGuard<T>
Borrow Read.
use seckey::SecKey; let secpass = SecKey::new([8u8; 8]).unwrap(); assert_eq!([8u8; 8], *secpass.read());
fn write(&mut self) -> SecWriteGuard<T>
Borrow Write.
let mut wpass = secpass.write(); wpass[0] = 0; assert_eq!([0, 8, 8, 8, 8, 8, 8, 8], *wpass);