pub struct MemoryAdapter { /* private fields */ }Expand description
In-memory adapter for RouchDB. All data is held in RAM.
Implementations§
Trait Implementations§
Source§impl Adapter for MemoryAdapter
impl Adapter for MemoryAdapter
Source§fn info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<DbInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn info<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<DbInfo>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get database information: name, document count, update sequence.
Source§fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
opts: GetOptions,
) -> Pin<Box<dyn Future<Output = Result<Document>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
opts: GetOptions,
) -> Pin<Box<dyn Future<Output = Result<Document>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve a single document by ID. Read more
Source§fn bulk_docs<'life0, 'async_trait>(
&'life0 self,
docs: Vec<Document>,
opts: BulkDocsOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<DocResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn bulk_docs<'life0, 'async_trait>(
&'life0 self,
docs: Vec<Document>,
opts: BulkDocsOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<DocResult>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Write multiple documents atomically. Read more
Source§fn all_docs<'life0, 'async_trait>(
&'life0 self,
opts: AllDocsOptions,
) -> Pin<Box<dyn Future<Output = Result<AllDocsResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn all_docs<'life0, 'async_trait>(
&'life0 self,
opts: AllDocsOptions,
) -> Pin<Box<dyn Future<Output = Result<AllDocsResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Query all documents, optionally filtered by key range.
Source§fn changes<'life0, 'async_trait>(
&'life0 self,
opts: ChangesOptions,
) -> Pin<Box<dyn Future<Output = Result<ChangesResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn changes<'life0, 'async_trait>(
&'life0 self,
opts: ChangesOptions,
) -> Pin<Box<dyn Future<Output = Result<ChangesResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get changes since a given sequence number.
Source§fn revs_diff<'life0, 'async_trait>(
&'life0 self,
revs: HashMap<String, Vec<String>>,
) -> Pin<Box<dyn Future<Output = Result<RevsDiffResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn revs_diff<'life0, 'async_trait>(
&'life0 self,
revs: HashMap<String, Vec<String>>,
) -> Pin<Box<dyn Future<Output = Result<RevsDiffResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Compare sets of document revisions to find which ones the adapter
is missing. Used during replication to avoid transferring data the
target already has.
Source§fn bulk_get<'life0, 'async_trait>(
&'life0 self,
docs: Vec<BulkGetItem>,
) -> Pin<Box<dyn Future<Output = Result<BulkGetResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn bulk_get<'life0, 'async_trait>(
&'life0 self,
docs: Vec<BulkGetItem>,
) -> Pin<Box<dyn Future<Output = Result<BulkGetResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Fetch multiple documents by ID and revision in a single request.
Used during replication to efficiently retrieve missing documents.
Source§fn put_attachment<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
doc_id: &'life1 str,
att_id: &'life2 str,
rev: &'life3 str,
data: Vec<u8>,
content_type: &'life4 str,
) -> Pin<Box<dyn Future<Output = Result<DocResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn put_attachment<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
doc_id: &'life1 str,
att_id: &'life2 str,
rev: &'life3 str,
data: Vec<u8>,
content_type: &'life4 str,
) -> Pin<Box<dyn Future<Output = Result<DocResult>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Store an attachment on a document.
Source§fn get_attachment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
doc_id: &'life1 str,
att_id: &'life2 str,
opts: GetAttachmentOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_attachment<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
doc_id: &'life1 str,
att_id: &'life2 str,
opts: GetAttachmentOptions,
) -> Pin<Box<dyn Future<Output = Result<Vec<u8>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Retrieve raw attachment data.
Source§fn get_local<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_local<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve a local document (not replicated, used for checkpoints).
Source§fn put_local<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
doc: Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn put_local<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
doc: Value,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Write a local document (not replicated, used for checkpoints).
Source§fn remove_local<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_local<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Remove a local document.
Source§impl Clone for MemoryAdapter
impl Clone for MemoryAdapter
Source§fn clone(&self) -> MemoryAdapter
fn clone(&self) -> MemoryAdapter
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for MemoryAdapter
impl !RefUnwindSafe for MemoryAdapter
impl Send for MemoryAdapter
impl Sync for MemoryAdapter
impl Unpin for MemoryAdapter
impl !UnwindSafe for MemoryAdapter
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