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
The user ID.
passphrase: Option<Passphrase>
The optional passphrase for user_id
.
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 Clone for Credentials
impl Clone for Credentials
Source§fn clone(&self) -> Credentials
fn clone(&self) -> Credentials
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 Credentials
impl Debug for Credentials
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<&FullCredentials> for Credentials
impl From<&FullCredentials> for Credentials
Source§fn from(value: &FullCredentials) -> Self
fn from(value: &FullCredentials) -> 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.
Source§impl From<FullCredentials> for Credentials
impl From<FullCredentials> for Credentials
Source§fn from(value: FullCredentials) -> Self
fn from(value: FullCredentials) -> Self
Converts to this type from the input type.
Source§impl TryFrom<&Credentials> for FullCredentials
impl TryFrom<&Credentials> for FullCredentials
Source§impl TryFrom<Credentials> for FullCredentials
impl TryFrom<Credentials> for FullCredentials
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