pub struct PolicyStorage { /* private fields */ }
Expand description
Manages access to the persistent storage. This layer on top of storage just migrates the legacy persisted data if it hasn’t been migrated yet.
Implementations§
Source§impl PolicyStorage
impl PolicyStorage
Sourcepub async fn new_with_id(id: &str) -> Self
pub async fn new_with_id(id: &str) -> Self
Initialize new store with the ID provided by the Saved Networks Manager. The ID will identify stored values as being part of the same persistent storage.
Sourcepub fn new_with_stash_proxy_and_id(
stash_proxy: SecureStoreProxy,
id: &str,
) -> Self
pub fn new_with_stash_proxy_and_id( stash_proxy: SecureStoreProxy, id: &str, ) -> Self
Initializer for tests outside of this module
Sourcepub async fn load(&mut self) -> Result<Vec<PersistentStorageData>, Error>
pub async fn load(&mut self) -> Result<Vec<PersistentStorageData>, Error>
Initialize the storage wrapper and load all saved network configs from persistent storage. If there is an error loading from local storage, that may mean stash data hasn’t been migrated yet. If so, the function will try to load from legacy stash data.
Auto Trait Implementations§
impl Freeze for PolicyStorage
impl !RefUnwindSafe for PolicyStorage
impl Send for PolicyStorage
impl Sync for PolicyStorage
impl Unpin for PolicyStorage
impl !UnwindSafe for PolicyStorage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more