pub enum AccountListenerRequest {
OnInitialize {
account_states: Vec<AccountAuthState>,
responder: AccountListenerOnInitializeResponder,
},
OnAccountAdded {
account_state: AccountAuthState,
responder: AccountListenerOnAccountAddedResponder,
},
OnAccountRemoved {
account_id: u64,
responder: AccountListenerOnAccountRemovedResponder,
},
OnAuthStateChanged {
account_auth_state: AccountAuthState,
responder: AccountListenerOnAuthStateChangedResponder,
},
}
Expand description
A protocol to receive events when the set of accounts on a device or the authentication states of these accounts change.
AccountListeners may be registered through the AccountManager protocol and this registration also defines which types of event should be sent to the listener. Optionally, the AccountListener will receive an initial state event onto which the change events may be safely accumulated.
All methods include an empty response to follow the “Throttle push using acknowledgements” FIDL design pattern.
Variants§
OnInitialize
A method that is called to communicate the initial set of accounts and their authentication states. OnInitialize is called exactly once if and only if AccountListenerOptions.initial_state was set when creating the AccountListener. When called, it will always be the first call on the channel. If no accounts are present on the device the vector will be empty.
account_states
The set of initial states.
OnAccountAdded
A method that is called when a new account is added to the device. This method is only called if AccountListenerOptions.add_account was set when creating the AccountListener.
account_state
The initial state for the newly added account.
OnAccountRemoved
A method that is called when a provisioned account is removed. This method is only called if AccountListenerOptions.remove_account was set when creating the AccountListener.
OnAuthStateChanged
A method that is called when the authentication state of any provisioned account changes.
Implementations§
source§impl AccountListenerRequest
impl AccountListenerRequest
pub fn into_on_initialize( self ) -> Option<(Vec<AccountAuthState>, AccountListenerOnInitializeResponder)>
pub fn into_on_account_added( self ) -> Option<(AccountAuthState, AccountListenerOnAccountAddedResponder)>
pub fn into_on_account_removed( self ) -> Option<(u64, AccountListenerOnAccountRemovedResponder)>
pub fn into_on_auth_state_changed( self ) -> Option<(AccountAuthState, AccountListenerOnAuthStateChangedResponder)>
sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL