pub struct MemoryStorageAdaptor { /* private fields */ }Expand description
In-memory storage adaptor for testing and simple use cases.
This implementation stores records in partition-keyed HashMaps.
Each partition has its own map.
§Example
let storage = StorageAdaptorWrapper::new(MemoryStorageAdaptor::new());
let properties = WalletProperties {
network: Network::Testnet,
fingerprint: Fingerprint::default(),
server_pubkey: None,
};
storage.init_wallet(&properties).await?;Implementations§
Trait Implementations§
Source§impl Debug for MemoryStorageAdaptor
impl Debug for MemoryStorageAdaptor
Source§impl Default for MemoryStorageAdaptor
impl Default for MemoryStorageAdaptor
Source§fn default() -> MemoryStorageAdaptor
fn default() -> MemoryStorageAdaptor
Returns the “default value” for a type. Read more
Source§impl StorageAdaptor for MemoryStorageAdaptor
impl StorageAdaptor for MemoryStorageAdaptor
Source§fn put<'life0, 'async_trait>(
&'life0 mut self,
record: Record,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn put<'life0, 'async_trait>(
&'life0 mut self,
record: Record,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Stores a record, inserting or updating by primary key.
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
partition: u8,
pk: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Option<Record>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
partition: u8,
pk: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Option<Record>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieves a record by primary key. Read more
Source§fn delete<'life0, 'life1, 'async_trait>(
&'life0 mut self,
partition: u8,
pk: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Option<Record>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete<'life0, 'life1, 'async_trait>(
&'life0 mut self,
partition: u8,
pk: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<Option<Record>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Deletes a record by primary key. Read more
Auto Trait Implementations§
impl Freeze for MemoryStorageAdaptor
impl RefUnwindSafe for MemoryStorageAdaptor
impl Send for MemoryStorageAdaptor
impl Sync for MemoryStorageAdaptor
impl Unpin for MemoryStorageAdaptor
impl UnwindSafe for MemoryStorageAdaptor
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
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request