pub struct AccountManagerProxy { /* private fields */ }

Implementations§

source§

impl AccountManagerProxy

source

pub fn new(channel: AsyncChannel) -> Self

Create a new Proxy for AccountManager

source

pub fn take_event_stream(&self) -> AccountManagerEventStream

Get a Stream of events from the remote end of the AccountManager protocol

Panics

Panics if the event stream was already taken.

source

pub fn get_account_ids(&self) -> QueryResponseFut<Vec<u64>>

Returns a vector of all accounts provisioned on the device.

source

pub fn get_account_metadata( &self, id: u64 ) -> QueryResponseFut<AccountManagerGetAccountMetadataResult>

Returns the metadata for a single account.

id The account’s identifier as returned by GetAccountIds()

source

pub fn get_account( &self, payload: AccountManagerGetAccountRequest ) -> QueryResponseFut<AccountManagerGetAccountResult>

Connects a channel to read properties of and perform operations on one account. If the account is locked, an interactive authentication attempt will be invoked as part of this call.

id [required] The account’s identifier as returned by GetAccountIds() interaction An Interaction channel enabling the user to complete authentication challenges if these are necessary. account [required] The server end of an Account channel

Fails with:

  • INVALID_REQUEST if the id does not exist.
  • FAILED_PRECONDITION if the account is locked but no interaction channel was supplied to perform authentication.
  • ABORTED if the client closes the interaction channel.
source

pub fn deprecated_get_account( &self, id: u64, password: &str, account: ServerEnd<AccountMarker> ) -> QueryResponseFut<AccountManagerDeprecatedGetAccountResult>

Connects a channel to read properties of and perform operations on one account. If the account is locked, the supplied password will be used to attempt authentication.

This is a temporary method used for an initial prototype of password-based encryption. Its usage will be replaced by the GetAccount method where the hardcoded authentication=password assumption is replaced by a channel that can support different authentication mechanisms.

id The account’s identifier as returned by GetAccountIds() password The account’s password account The server end of an Account channel

Fails with FAILED_AUTHENTICATION if the password was not correct.

source

pub fn register_account_listener( &self, payload: AccountManagerRegisterAccountListenerRequest ) -> QueryResponseFut<AccountManagerRegisterAccountListenerResult>

Connects a channel that will receive changes in the provisioned accounts and their authentication state. Optionally this channel will also receive the initial set of accounts and authentication states onto which changes may be applied.

listener [required] The client end of an AccountListener channel initial_state If true, the listener will receive an event containing the initial state for all accounts. add_account If true, the listener will receive events when a new account is added to the device. remove_account If true, the listener will receive events when an account is removed from the device. granularity An AuthChangeGranularity expressing the magnitude of change in authentication state that will lead to AuthStateChange events. If absent, AuthStateChange events will not be sent.

source

pub fn remove_account( &self, id: u64 ) -> QueryResponseFut<AccountManagerRemoveAccountResult>

Removes an account from the device.

id The account’s identifier as returned by GetAccountIds()

source

pub fn provision_new_account( &self, payload: AccountManagerProvisionNewAccountRequest ) -> QueryResponseFut<AccountManagerProvisionNewAccountResult>

Adds a new account to the device. If this operation if successful the newly created account will be unlocked and may be accessed using GetAccount without further authentication.

lifetime [required] The lifetime of the account metadata [required] Metadata for the new account interaction An Interaction channel enabling the user to select and enroll authentication mechanisms for the new account.

Returns: account_id The identifier of the newly added account

Fails with:

  • INVALID_REQUEST if policy requires authentication factors for the new account but no interaction channel was supplied.
  • ABORTED if the client closes the interaction channel.
source

pub fn deprecated_provision_new_account( &self, password: &str, metadata: AccountMetadata, account: ServerEnd<AccountMarker> ) -> QueryResponseFut<AccountManagerDeprecatedProvisionNewAccountResult>

Adds a new system account to the device using the supplied password as the only authentication mechanism. The account is automatically unlocked and the supplied channel is connected to read properties of and perform operations on the account.

This is a temporary method used for an initial prototype of password-based encryption. Its usage will be replaced by the ProvisionNewAccount method where the hardcoded authentication=password assumption is replaced by a channel that can support different authentication mechanisms.

password The password to be used for the new account metadata Metadata for the new account account The server end of an Account channel

Fails with INVALID_REQUEST if the password does not meet minimum strength requirements.

Trait Implementations§

source§

impl AccountManagerProxyInterface for AccountManagerProxy

§

type GetAccountIdsResponseFut = QueryResponseFut<Vec<u64, Global>>

source§

fn get_account_ids(&self) -> Self::GetAccountIdsResponseFut

§

type GetAccountMetadataResponseFut = QueryResponseFut<Result<AccountMetadata, Error>>

source§

fn get_account_metadata(&self, id: u64) -> Self::GetAccountMetadataResponseFut

§

type GetAccountResponseFut = QueryResponseFut<Result<(), Error>>

source§

fn get_account( &self, payload: AccountManagerGetAccountRequest ) -> Self::GetAccountResponseFut

§

type DeprecatedGetAccountResponseFut = QueryResponseFut<Result<(), Error>>

source§

fn deprecated_get_account( &self, id: u64, password: &str, account: ServerEnd<AccountMarker> ) -> Self::DeprecatedGetAccountResponseFut

§

type RegisterAccountListenerResponseFut = QueryResponseFut<Result<(), Error>>

source§

fn register_account_listener( &self, payload: AccountManagerRegisterAccountListenerRequest ) -> Self::RegisterAccountListenerResponseFut

§

type RemoveAccountResponseFut = QueryResponseFut<Result<(), Error>>

source§

fn remove_account(&self, id: u64) -> Self::RemoveAccountResponseFut

§

type ProvisionNewAccountResponseFut = QueryResponseFut<Result<u64, Error>>

source§

fn provision_new_account( &self, payload: AccountManagerProvisionNewAccountRequest ) -> Self::ProvisionNewAccountResponseFut

§

type DeprecatedProvisionNewAccountResponseFut = QueryResponseFut<Result<(), Error>>

source§

fn deprecated_provision_new_account( &self, password: &str, metadata: AccountMetadata, account: ServerEnd<AccountMarker> ) -> Self::DeprecatedProvisionNewAccountResponseFut

source§

impl Clone for AccountManagerProxy

source§

fn clone(&self) -> AccountManagerProxy

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for AccountManagerProxy

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Proxy for AccountManagerProxy

§

type Protocol = AccountManagerMarker

The protocol which this Proxy controls.
source§

fn from_channel(inner: AsyncChannel) -> Self

Create a proxy over the given channel.
source§

fn into_channel(self) -> Result<AsyncChannel, Self>

Attempt to convert the proxy back into a channel. Read more
source§

fn as_channel(&self) -> &AsyncChannel

Get a reference to the proxy’s underlying channel. Read more
§

fn is_closed(&self) -> bool

Returns true if the proxy has received the PEER_CLOSED signal.
§

fn on_closed<'a>(&'a self) -> OnSignals<'a>

Returns a future that completes when the proxy receives the PEER_CLOSED signal.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more