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
§impl<T> CompatExt for T
impl<T> CompatExt for 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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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