pub async fn handle_request<'a>(
        &'a self,
        context: &'a AccountContext,
        req: AccountRequest,
    ) -> Result<(), fidl::Error> {
        match req {
            AccountRequest::GetAccountName { responder } => {
                let response = self.get_account_name();
                responder.send(&response)?;
            }
            AccountRequest::GetLifetime { responder } => {
                let response = self.get_lifetime();
                responder.send(response)?;
            }
            AccountRequest::GetAuthState { scenario, responder } => {
                let mut response = self.get_auth_state(scenario);
                responder.send(&mut response)?;
            }
            AccountRequest::RegisterAuthListener {
                scenario,
                listener,
                initial_state,
                granularity,
                responder,
            } => {
                let mut response =
                    self.register_auth_listener(scenario, listener, initial_state, granularity);
                responder.send(&mut response)?;
            }
            AccountRequest::GetPersonaIds { responder } => {
                let response = self.get_persona_ids();
                responder.send(&response)?;
            }
            AccountRequest::GetDefaultPersona { persona, responder } => {
                let mut response = self.get_default_persona(context, persona).await;
                responder.send(&mut response)?;
            }
            AccountRequest::GetPersona { id, persona, responder } => {
                let mut response = self.get_persona(context, id.into(), persona).await;
                responder.send(&mut response)?;
            }
            AccountRequest::GetRecoveryAccount { responder } => {
                let mut response =
                    self.get_recovery_account().map(|option| option.map(|value| Box::new(value)));
                responder.send(&mut response)?;
            }
            AccountRequest::SetRecoveryAccount { account, responder } => {
                let mut response = self.set_recovery_account(account);
                responder.send(&mut response)?;
            }
            AccountRequest::GetAuthMechanismEnrollments { responder, .. } => {
                responder.send(&mut Err(ApiError::UnsupportedOperation))?;
            }
            AccountRequest::CreateAuthMechanismEnrollment { responder, .. } => {
                responder.send(&mut Err(ApiError::UnsupportedOperation))?;
            }
            AccountRequest::RemoveAuthMechanismEnrollment { responder, .. } => {
                responder.send(&mut Err(ApiError::UnsupportedOperation))?;
            }
            AccountRequest::Lock { responder } => {
                let mut response = self.lock().await;
                responder.send(&mut response)?;
            }
            AccountRequest::GetDataDirectory { responder, .. } => {
                responder.send(&mut Err(ApiError::UnsupportedOperation))?;
            }
        }
        Ok(())
    }
/// Dispatches an `AccountRequest` message to the appropriate handler method
/// based on its type.
Dispatches an `AccountRequest` message to the appropriate handler method
based on its type.
Dispatches an ` AccountRequest ` message to the appropriate handler method based on its type .
pub async fn handle_request<'a>(
        &'a self,
        context: &'a AccountContext,
        req: AccountRequest,
    ) -> Result<(), fidl::Error> {
        match req {
            AccountRequest::GetAccountName { responder } => {
                let response = self.get_account_name();
                responder.send(&response)?;
            }
            AccountRequest::GetLifetime { responder } => {
                let response = self.get_lifetime();
                responder.send(response)?;
            }
            AccountRequest::GetAuthState { scenario, responder } => {
                let mut response = self.get_auth_state(scenario);
                responder.send(&mut response)?;
            }
            AccountRequest::RegisterAuthListener {
                scenario,
                listener,
                initial_state,
                granularity,
                responder,
            } => {
                let mut response =
                    self.register_auth_listener(scenario, listener, initial_state, granularity);
                responder.send(&mut response)?;
            }
            AccountRequest::GetPersonaIds { responder } => {
                let response = self.get_persona_ids();
                responder.send(&response)?;
            }
            AccountRequest::GetDefaultPersona { persona, responder } => {
                let mut response = self.get_default_persona(context, persona).await;
                responder.send(&mut response)?;
            }
            AccountRequest::GetPersona { id, persona, responder } => {
                let mut response = self.get_persona(context, id.into(), persona).await;
                responder.send(&mut response)?;
            }
            AccountRequest::GetRecoveryAccount { responder } => {
                let mut response =
                    self.get_recovery_account().map(|option| option.map(|value| Box::new(value)));
                responder.send(&mut response)?;
            }
            AccountRequest::SetRecoveryAccount { account, responder } => {
                let mut response = self.set_recovery_account(account);
                responder.send(&mut response)?;
            }
            AccountRequest::GetAuthMechanismEnrollments { responder, .. } => {
                responder.send(&mut Err(ApiError::UnsupportedOperation))?;
            }
            AccountRequest::CreateAuthMechanismEnrollment { responder, .. } => {
                responder.send(&mut Err(ApiError::UnsupportedOperation))?;
            }
            AccountRequest::RemoveAuthMechanismEnrollment { responder, .. } => {
                responder.send(&mut Err(ApiError::UnsupportedOperation))?;
            }
            AccountRequest::Lock { responder } => {
                let mut response = self.lock().await;
                responder.send(&mut response)?;
            }
            AccountRequest::GetDataDirectory { responder, .. } => {
                responder.send(&mut Err(ApiError::UnsupportedOperation))?;
            }
        }
        Ok(())
    }
pub async fn handle_request < ' a > ( & ' a self , context : & ' a AccountContext , req : AccountRequest , ) -> Result < ( ) , fidl :: Error > { match req { AccountRequest :: GetAccountName { responder } => { let response = self . get_account_name ( ) ; responder . send ( & response ) ? ; } AccountRequest :: GetLifetime { responder } => { let response = self . get_lifetime ( ) ; responder . send ( response ) ? ; } AccountRequest :: GetAuthState { scenario , responder } => { let mut response = self . get_auth_state ( scenario ) ; responder . send ( & mut response ) ? ; } AccountRequest :: RegisterAuthListener { scenario , listener , initial_state , granularity , responder , } => { let mut response = self . register_auth_listener ( scenario , listener , initial_state , granularity ) ; responder . send ( & mut response ) ? ; } AccountRequest :: GetPersonaIds { responder } => { let response = self . get_persona_ids ( ) ; responder . send ( & response ) ? ; } AccountRequest :: GetDefaultPersona { persona , responder } => { let mut response = self . get_default_persona ( context , persona ) . await ; responder . send ( & mut response ) ? ; } AccountRequest :: GetPersona { id , persona , responder } => { let mut response = self . get_persona ( context , id . into ( ) , persona ) . await ; responder . send ( & mut response ) ? ; } AccountRequest :: GetRecoveryAccount { responder } => { let mut response = self . get_recovery_account ( ) . map ( | option | option . map ( | value | Box :: new ( value ) ) ) ; responder . send ( & mut response ) ? ; } AccountRequest :: SetRecoveryAccount { account , responder } => { let mut response = self . set_recovery_account ( account ) ; responder . send ( & mut response ) ? ; } AccountRequest :: GetAuthMechanismEnrollments { responder , .. } => { responder . send ( & mut Err ( ApiError :: UnsupportedOperation ) ) ? ; } AccountRequest :: CreateAuthMechanismEnrollment { responder , .. } => { responder . send ( & mut Err ( ApiError :: UnsupportedOperation ) ) ? ; } AccountRequest :: RemoveAuthMechanismEnrollment { responder , .. } => { responder . send ( & mut Err ( ApiError :: UnsupportedOperation ) ) ? ; } AccountRequest :: Lock { responder } => { let mut response = self . lock ( ) . await ; responder . send ( & mut response ) ? ; } AccountRequest :: GetDataDirectory { responder , .. } => { responder . send ( & mut Err ( ApiError :: UnsupportedOperation ) ) ? ; } } Ok ( ( ) ) }
Dispatches an `AccountRequest` message to the appropriate handler method
based on its type.
Dispatches an ` AccountRequest ` message to the appropriate handler method based on its type .
&'a self
context
&'a AccountContext
req
AccountRequest
&'a self
context
&'a AccountContext
req
AccountRequest