pub struct Credentials {
pub user_id: UserId,
pub passphrase: Option<Passphrase>,
}
Expand description
Credentials for a NetHsm
Holds a user ID and an accompanying Passphrase
.
Fields§
§user_id: UserId
§passphrase: Option<Passphrase>
Implementations§
source§impl Credentials
impl Credentials
sourcepub fn new(user_id: UserId, passphrase: Option<Passphrase>) -> Self
pub fn new(user_id: UserId, passphrase: Option<Passphrase>) -> Self
Creates a new Credentials
§Examples
use nethsm::{Credentials, Passphrase};
let creds = Credentials::new(
"operator".parse()?,
Some(Passphrase::new("passphrase".to_string())),
);
Trait Implementations§
source§impl From<&Credentials> for BasicAuth
impl From<&Credentials> for BasicAuth
source§fn from(value: &Credentials) -> Self
fn from(value: &Credentials) -> Self
Converts to this type from the input type.
source§impl From<Credentials> for BasicAuth
impl From<Credentials> for BasicAuth
source§fn from(value: Credentials) -> Self
fn from(value: Credentials) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for Credentials
impl RefUnwindSafe for Credentials
impl Send for Credentials
impl Sync for Credentials
impl Unpin for Credentials
impl UnwindSafe for Credentials
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