pub struct Passphrase(SecretString);
Expand description
A secret passphrase
The passphrase is held by a [SecretString
], which guarantees zeroing of memory on
destruct.
Tuple Fields§
§0: SecretString
Implementations§
source§impl Passphrase
impl Passphrase
sourcepub fn new(passphrase: String) -> Self
pub fn new(passphrase: String) -> Self
Creates a new Passphrase
from owned String
§Examples
use nethsm::Passphrase;
let passphrase = Passphrase::new("passphrase".to_string());
sourcepub fn expose_owned(&self) -> String
pub fn expose_owned(&self) -> String
Exposes the secret passphrase as owned String
This is a convenience function, as much of [nethsm_sdk_rs
] exclusively deals with owned
strings.
sourcepub fn expose_borrowed(&self) -> &str
pub fn expose_borrowed(&self) -> &str
Exposes the secret passphrase as borrowed str
Trait Implementations§
source§impl Clone for Passphrase
impl Clone for Passphrase
source§fn clone(&self) -> Passphrase
fn clone(&self) -> Passphrase
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for Passphrase
impl Debug for Passphrase
Auto Trait Implementations§
impl Freeze for Passphrase
impl RefUnwindSafe for Passphrase
impl Send for Passphrase
impl Sync for Passphrase
impl Unpin for Passphrase
impl UnwindSafe for Passphrase
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)