Struct sequoia_openpgp::crypto::Password [−][src]
pub struct Password(_);
Holds a password.
Password
s can be converted from various types using From
.
The password is encrypted in memory and only decrypted on demand.
See mem::Encrypted
for details.
Examples
use sequoia_openpgp as openpgp; use openpgp::crypto::Password; // Convert from a &str. let p: Password = "hunter2".into(); // Convert from a &[u8]. let p: Password = b"hunter2"[..].into(); // Convert from a String. let p: Password = String::from("hunter2").into(); // ...
Implementations
impl Password
[src]
impl Password
[src]pub fn map<F, T>(&self, fun: F) -> T where
F: FnMut(&Protected) -> T,
[src]
pub fn map<F, T>(&self, fun: F) -> T where
F: FnMut(&Protected) -> T,
[src]Maps the given function over the password.
The password is stored encrypted in memory. This function temporarily decrypts it for the given function to use.
Examples
use sequoia_openpgp as openpgp; use openpgp::crypto::Password; let p: Password = "hunter2".into(); p.map(|p| assert_eq!(p.as_ref(), &b"hunter2"[..]));
Trait Implementations
impl Eq for Password
[src]
impl StructuralEq for Password
[src]
impl StructuralPartialEq for Password
[src]
Auto Trait Implementations
impl RefUnwindSafe for Password
impl Send for Password
impl Sync for Password
impl Unpin for Password
impl UnwindSafe for Password
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> Same<T> for T
impl<T> Same<T> for T
type Output = T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more