pub struct IndexeddbCryptoStore { /* private fields */ }Expand description
An implementation of CryptoStore that uses IndexedDB for persistent storage.
Implementations§
Source§impl IndexeddbCryptoStore
impl IndexeddbCryptoStore
Sourcepub async fn open() -> Result<Self, IndexeddbCryptoStoreError>
pub async fn open() -> Result<Self, IndexeddbCryptoStoreError>
Open a new IndexeddbCryptoStore with default name and no passphrase
Sourcepub async fn open_with_passphrase(
prefix: &str,
passphrase: &str,
) -> Result<Self, IndexeddbCryptoStoreError>
pub async fn open_with_passphrase( prefix: &str, passphrase: &str, ) -> Result<Self, IndexeddbCryptoStoreError>
Open an IndexeddbCryptoStore with given name and passphrase.
If the store previously existed, the encryption cipher is initialised using the given passphrase and the details from the meta store. If the store did not previously exist, a new encryption cipher is derived from the passphrase, and the details are stored to the metastore.
The store is then opened, or a new one created, using the encryption cipher.
§Arguments
prefix- Common prefix for the names of the two IndexedDB stores.passphrase- Passphrase which is used to derive a key to encrypt the key which is used to encrypt the store. Must be the same each time the store is opened.
Sourcepub async fn open_with_key(
prefix: &str,
key: &[u8; 32],
) -> Result<Self, IndexeddbCryptoStoreError>
pub async fn open_with_key( prefix: &str, key: &[u8; 32], ) -> Result<Self, IndexeddbCryptoStoreError>
Open an IndexeddbCryptoStore with given name and key.
If the store previously existed, the encryption cipher is initialised using the given key and the details from the meta store. If the store did not previously exist, a new encryption cipher is derived from the passphrase, and the details are stored to the metastore.
The store is then opened, or a new one created, using the encryption cipher.
§Arguments
prefix- Common prefix for the names of the two IndexedDB stores.key- Key with which to encrypt the key which is used to encrypt the store. Must be the same each time the store is opened.
Sourcepub async fn open_with_name(
name: &str,
) -> Result<Self, IndexeddbCryptoStoreError>
pub async fn open_with_name( name: &str, ) -> Result<Self, IndexeddbCryptoStoreError>
Open a new IndexeddbCryptoStore with given name and no passphrase
Trait Implementations§
Source§impl Debug for IndexeddbCryptoStore
impl Debug for IndexeddbCryptoStore
Auto Trait Implementations§
impl !Freeze for IndexeddbCryptoStore
impl !RefUnwindSafe for IndexeddbCryptoStore
impl !Send for IndexeddbCryptoStore
impl !Sync for IndexeddbCryptoStore
impl Unpin for IndexeddbCryptoStore
impl !UnwindSafe for IndexeddbCryptoStore
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
Source§impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
impl<T, W> HasTypeWitness<W> for Twhere
W: MakeTypeWitness<Arg = T>,
T: ?Sized,
Source§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more