pub fn new(
        data_dir: PathBuf,
        auth_provider_config: &[AuthProviderConfig],
    ) -> Result<AccountManager, Error> {
        let context = Arc::new(AccountHandlerContext::new(auth_provider_config));
        let mut ids_to_handlers = AccountMap::new();
        let account_list = StoredAccountList::load(&data_dir)?;
        for account in account_list.accounts().into_iter() {
            ids_to_handlers.insert(account.account_id().clone(), None);
        }
        Ok(Self {
            ids_to_handlers: Mutex::new(ids_to_handlers),
            context,
            event_emitter: AccountEventEmitter::new(),
            data_dir,
        })
    }
/// Constructs a new AccountManager, loading existing set of accounts from `data_dir`, and an
/// auth provider configuration. The directory must exist at construction.
Constructs a new AccountManager, loading existing set of accounts from `data_dir`, and an
auth provider configuration. The directory must exist at construction.
Constructs a new AccountManager loading existing set of accounts from ` data_dir ` and an auth provider configuration . The directory must exist at construction .
pub fn new(
        data_dir: PathBuf,
        auth_provider_config: &[AuthProviderConfig],
    ) -> Result<AccountManager, Error> {
        let context = Arc::new(AccountHandlerContext::new(auth_provider_config));
        let mut ids_to_handlers = AccountMap::new();
        let account_list = StoredAccountList::load(&data_dir)?;
        for account in account_list.accounts().into_iter() {
            ids_to_handlers.insert(account.account_id().clone(), None);
        }
        Ok(Self {
            ids_to_handlers: Mutex::new(ids_to_handlers),
            context,
            event_emitter: AccountEventEmitter::new(),
            data_dir,
        })
    }
pub fn new ( data_dir : PathBuf , auth_provider_config : & [ AuthProviderConfig ] , ) -> Result < AccountManager , Error > { let context = Arc :: new ( AccountHandlerContext :: new ( auth_provider_config ) ) ; let mut ids_to_handlers = AccountMap :: new ( ) ; let account_list = StoredAccountList :: load ( & data_dir ) ? ; for account in account_list . accounts ( ) . into_iter ( ) { ids_to_handlers . insert ( account . account_id ( ) . clone ( ) , None ) ; } Ok ( Self { ids_to_handlers : Mutex :: new ( ids_to_handlers ) , context , event_emitter : AccountEventEmitter :: new ( ) , data_dir , } ) }
Constructs a new AccountManager, loading existing set of accounts from `data_dir`, and an
auth provider configuration.
Constructs a new AccountManager loading existing set of accounts from ` data_dir ` and an auth provider configuration .
data_dir
PathBuf
auth_provider_config
&[AuthProviderConfig]
data_dir
PathBuf
auth_provider_config
&[AuthProviderConfig]