pub struct DeviceEnrollment { /* private fields */ }Available on crate feature
pairing only.Expand description
Enroll a device.
Once pairing is completed call DeviceEnrollment::fetch_account to retrieve the account data and then DeviceEnrollment::finish to authenticate the account.
Implementations§
Source§impl DeviceEnrollment
impl DeviceEnrollment
Sourcepub fn account_id(&self) -> &AccountId
pub fn account_id(&self) -> &AccountId
Account identifier.
Sourcepub fn public_identity(&self) -> Option<&PublicIdentity>
pub fn public_identity(&self) -> Option<&PublicIdentity>
Public identity of the account.
Only available after a successful call to DeviceEnrollment::fetch_account.
Sourcepub async fn fetch_account(&mut self) -> Result<()>
pub async fn fetch_account(&mut self) -> Result<()>
Fetch the account data for this enrollment.
Sourcepub async fn finish(&self, key: &AccessKey) -> Result<NetworkAccount>
pub async fn finish(&self, key: &AccessKey) -> Result<NetworkAccount>
Finish device enrollment by authenticating the new account.
Auto Trait Implementations§
impl Freeze for DeviceEnrollment
impl !RefUnwindSafe for DeviceEnrollment
impl Send for DeviceEnrollment
impl Sync for DeviceEnrollment
impl Unpin for DeviceEnrollment
impl !UnwindSafe for DeviceEnrollment
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> 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 more