pub async fn create(
        lifetime: AccountLifetime,
        context_proxy: AccountHandlerContextProxy,
        lock_request_sender: lock_request::Sender,
        inspect_parent: &Node,
    ) -> Result<Account, AccountManagerError> {
        let global_account_id = Self::generate_global_account_id()?;
        let local_persona_id = LocalPersonaId::new(rand::random::<u64>());
        if let AccountLifetime::Persistent { ref account_dir } = lifetime {
            if StoredAccount::path(account_dir).exists() {
                info!("Attempting to create account twice");
                return Err(AccountManagerError::new(ApiError::Internal));
            }
            let stored_account =
                StoredAccount::new(local_persona_id.clone(), global_account_id.clone());
            stored_account.save(account_dir)?;
        }
        Self::new(
            local_persona_id,
            global_account_id,
            lifetime,
            context_proxy,
            lock_request_sender,
            inspect_parent,
        )
        .await
    }
/// Creates a new Fuchsia account and, if it is persistent, stores it on disk.
Creates a new Fuchsia account and, if it is persistent, stores it on disk.
Creates a new Fuchsia account and if it is persistent stores it on disk .
pub async fn create(
        lifetime: AccountLifetime,
        context_proxy: AccountHandlerContextProxy,
        lock_request_sender: lock_request::Sender,
        inspect_parent: &Node,
    ) -> Result<Account, AccountManagerError> {
        let global_account_id = Self::generate_global_account_id()?;
        let local_persona_id = LocalPersonaId::new(rand::random::<u64>());
        if let AccountLifetime::Persistent { ref account_dir } = lifetime {
            if StoredAccount::path(account_dir).exists() {
                info!("Attempting to create account twice");
                return Err(AccountManagerError::new(ApiError::Internal));
            }
            let stored_account =
                StoredAccount::new(local_persona_id.clone(), global_account_id.clone());
            stored_account.save(account_dir)?;
        }
        Self::new(
            local_persona_id,
            global_account_id,
            lifetime,
            context_proxy,
            lock_request_sender,
            inspect_parent,
        )
        .await
    }
pub async fn create ( lifetime : AccountLifetime , context_proxy : AccountHandlerContextProxy , lock_request_sender : lock_request :: Sender , inspect_parent : & Node , ) -> Result < Account , AccountManagerError > { let global_account_id = Self :: generate_global_account_id ( ) ? ; let local_persona_id = LocalPersonaId :: new ( rand :: random :: < u64 > ( ) ) ; if let AccountLifetime :: Persistent { ref account_dir } = lifetime { if StoredAccount :: path ( account_dir ) . exists ( ) { info ! ( " " ) ; return Err ( AccountManagerError :: new ( ApiError :: Internal ) ) ; } let stored_account = StoredAccount :: new ( local_persona_id . clone ( ) , global_account_id . clone ( ) ) ; stored_account . save ( account_dir ) ? ; } Self :: new ( local_persona_id , global_account_id , lifetime , context_proxy , lock_request_sender , inspect_parent , ) . await }
Creates a new Fuchsia account and, if it is persistent, stores it on disk.
Creates a new Fuchsia account and if it is persistent stores it on disk .
lifetime
AccountLifetime
context_proxy
AccountHandlerContextProxy
lock_request_sender
lock_request::Sender
inspect_parent
&Node
lifetime
AccountLifetime
context_proxy
AccountHandlerContextProxy
lock_request_sender
lock_request::Sender
inspect_parent
&Node