pub struct TrustedDevice {
pub device_group_key: String,
pub device_key: String,
pub device_password: String,
}
Expand description
A trusted device is a device that has been confirmed.
Hive uses AWS Cognito for authentication, and a trusted device in a Hive account is actually a tracked device in AWS Cognito.
See the AWS Cognito documentation for more information.
Fields§
§device_group_key: String
§device_key: String
§device_password: String
Implementations§
Source§impl TrustedDevice
impl TrustedDevice
Sourcepub fn new<'a>(
device_password: &'a str,
device_group_key: &'a str,
device_key: &'a str,
) -> Self
pub fn new<'a>( device_password: &'a str, device_group_key: &'a str, device_key: &'a str, ) -> Self
Create a new trusted device which can be used to authenticate the user.
use hive_client::authentication::{TrustedDevice, User};
// Create the trusted device with the device password, group key and key.
let trusted_device = TrustedDevice::new(
"device_password",
"device_group_key",
"device_key"
);
/// Assign the trusted device to the user.
let user = User::new(
"username",
"password",
Some(trusted_device)
);
Trait Implementations§
Source§impl Clone for TrustedDevice
impl Clone for TrustedDevice
Source§fn clone(&self) -> TrustedDevice
fn clone(&self) -> TrustedDevice
Returns a duplicate 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 moreAuto Trait Implementations§
impl Freeze for TrustedDevice
impl RefUnwindSafe for TrustedDevice
impl Send for TrustedDevice
impl Sync for TrustedDevice
impl Unpin for TrustedDevice
impl UnwindSafe for TrustedDevice
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreCreates a shared type from an unshared type.