Struct identity_account_storage::storage::MemStore
source · [−]pub struct MemStore { /* private fields */ }
Expand description
An insecure, in-memory Storage
implementation that serves as an example and is used in tests.
Implementations
Trait Implementations
sourceimpl Storage for MemStore
impl Storage for MemStore
sourcefn did_create<'life0, 'life1, 'async_trait>(
&'life0 self,
network: NetworkName,
fragment: &'life1 str,
private_key: Option<PrivateKey>
) -> Pin<Box<dyn Future<Output = Result<(IotaDID, KeyLocation)>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn did_create<'life0, 'life1, 'async_trait>(
&'life0 self,
network: NetworkName,
fragment: &'life1 str,
private_key: Option<PrivateKey>
) -> Pin<Box<dyn Future<Output = Result<(IotaDID, KeyLocation)>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Creates a new identity for the given network
. Read more
sourcefn did_purge<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn did_purge<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Removes the keys and any other state for the given did
. Read more
sourcefn did_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn did_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Returns true
if did
exists in the list of stored DIDs.
sourcefn did_list<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<IotaDID>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
fn did_list<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<Vec<IotaDID>>> + Send + 'async_trait>> where
'life0: 'async_trait,
Self: 'async_trait,
Returns the list of stored DIDs.
sourcefn key_generate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
key_type: KeyType,
fragment: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<KeyLocation>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn key_generate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
key_type: KeyType,
fragment: &'life2 str
) -> Pin<Box<dyn Future<Output = Result<KeyLocation>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Generates a new key for the given did
with the given key_type
and fragment
identifier
and returns the location of the newly generated key. Read more
sourcefn key_insert<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
location: &'life2 KeyLocation,
private_key: PrivateKey
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn key_insert<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
location: &'life2 KeyLocation,
private_key: PrivateKey
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Inserts a private key at the specified location
. Read more
sourcefn key_exists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
location: &'life2 KeyLocation
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn key_exists<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
location: &'life2 KeyLocation
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Returns true
if a key exists at the specified location
.
sourcefn key_public<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
location: &'life2 KeyLocation
) -> Pin<Box<dyn Future<Output = Result<PublicKey>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn key_public<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
location: &'life2 KeyLocation
) -> Pin<Box<dyn Future<Output = Result<PublicKey>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Retrieves the public key from location
.
sourcefn key_delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
location: &'life2 KeyLocation
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn key_delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
location: &'life2 KeyLocation
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Deletes the key at location
. Read more
sourcefn key_sign<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
location: &'life2 KeyLocation,
data: Vec<u8>
) -> Pin<Box<dyn Future<Output = Result<Signature>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn key_sign<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
location: &'life2 KeyLocation,
data: Vec<u8>
) -> Pin<Box<dyn Future<Output = Result<Signature>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Signs data
with the private key at the specified location
.
sourcefn data_encrypt<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_did: &'life1 IotaDID,
plaintext: Vec<u8>,
associated_data: Vec<u8>,
encryption_algorithm: &'life2 EncryptionAlgorithm,
cek_algorithm: &'life3 CekAlgorithm,
public_key: PublicKey
) -> Pin<Box<dyn Future<Output = Result<EncryptedData>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn data_encrypt<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
_did: &'life1 IotaDID,
plaintext: Vec<u8>,
associated_data: Vec<u8>,
encryption_algorithm: &'life2 EncryptionAlgorithm,
cek_algorithm: &'life3 CekAlgorithm,
public_key: PublicKey
) -> Pin<Box<dyn Future<Output = Result<EncryptedData>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
Encrypts the given plaintext
with the specified encryption_algorithm
and cek_algorithm
. Read more
sourcefn data_decrypt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
data: EncryptedData,
encryption_algorithm: &'life2 EncryptionAlgorithm,
cek_algorithm: &'life3 CekAlgorithm,
private_key: &'life4 KeyLocation
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
fn data_decrypt<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
data: EncryptedData,
encryption_algorithm: &'life2 EncryptionAlgorithm,
cek_algorithm: &'life3 CekAlgorithm,
private_key: &'life4 KeyLocation
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Self: 'async_trait,
Decrypts the given data
with the specified encryption_algorithm
and cek_algorithm
. Read more
sourcefn chain_state_get<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID
) -> Pin<Box<dyn Future<Output = Result<Option<ChainState>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn chain_state_get<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID
) -> Pin<Box<dyn Future<Output = Result<Option<ChainState>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Returns the chain state of the identity specified by did
.
sourcefn chain_state_set<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
chain_state: &'life2 ChainState
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn chain_state_set<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
chain_state: &'life2 ChainState
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Set the chain state of the identity specified by did
.
sourcefn document_get<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID
) -> Pin<Box<dyn Future<Output = Result<Option<IotaDocument>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn document_get<'life0, 'life1, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID
) -> Pin<Box<dyn Future<Output = Result<Option<IotaDocument>>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Returns the IotaDocument
of the identity specified by did
.
sourcefn document_set<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
document: &'life2 IotaDocument
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
fn document_set<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
did: &'life1 IotaDID,
document: &'life2 IotaDocument
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Self: 'async_trait,
Sets a new state for the identity specified by did
.
Auto Trait Implementations
impl RefUnwindSafe for MemStore
impl Send for MemStore
impl Sync for MemStore
impl Unpin for MemStore
impl UnwindSafe for MemStore
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more