pub struct MemoryStore { /* private fields */ }Implementations§
Source§impl MemoryStore
impl MemoryStore
pub fn new() -> Self
Sourcepub fn with_clock(clock: impl Fn() -> i64 + Send + Sync + 'static) -> Self
pub fn with_clock(clock: impl Fn() -> i64 + Send + Sync + 'static) -> Self
A store whose “now” comes from clock (microseconds since the epoch). Commit times are
still strictly increasing if the clock stands still or goes backwards.
Sourcepub fn with_retention(self, retention: Duration) -> Self
pub fn with_retention(self, retention: Duration) -> Self
How long old versions stay readable after they are overwritten.
Trait Implementations§
Source§impl Default for MemoryStore
impl Default for MemoryStore
Source§impl Store for MemoryStore
impl Store for MemoryStore
Source§fn latest_read_time(&self, database: &str) -> ReadTime
fn latest_read_time(&self, database: &str) -> ReadTime
A read time that sees every commit made so far.
Source§fn earliest_read_time(&self, database: &str) -> ReadTime
fn earliest_read_time(&self, database: &str) -> ReadTime
The oldest read time still served; older versions may have been dropped.
fn get( &self, database: &str, path: &ResourcePath, at: ReadTime, ) -> Option<Arc<StoredDocument>>
Source§fn list_collection(
&self,
database: &str,
collection: &ResourcePath,
at: ReadTime,
options: ListOptions<'_>,
visit: &mut dyn FnMut(ListItem<'_>) -> ControlFlow<()>,
)
fn list_collection( &self, database: &str, collection: &ResourcePath, at: ReadTime, options: ListOptions<'_>, visit: &mut dyn FnMut(ListItem<'_>) -> ControlFlow<()>, )
Like
Store::scan_collection, with paging and missing documents.Source§fn scan_collection_group(
&self,
database: &str,
parent: &ResourcePath,
collection_id: &str,
at: ReadTime,
visit: &mut Visit<'_>,
)
fn scan_collection_group( &self, database: &str, parent: &ResourcePath, collection_id: &str, at: ReadTime, visit: &mut Visit<'_>, )
Every document under
parent (a document path, or the root) whose collection ID is
collection_id, at any depth, ordered by full path.Source§fn scan_descendants(
&self,
database: &str,
parent: &ResourcePath,
at: ReadTime,
visit: &mut Visit<'_>,
)
fn scan_descendants( &self, database: &str, parent: &ResourcePath, at: ReadTime, visit: &mut Visit<'_>, )
Every document below
parent (a document path, or the root), at any depth, ordered by
path. parent itself is not included.Source§fn list_collection_ids(
&self,
database: &str,
parent: &ResourcePath,
at: ReadTime,
) -> Vec<String>
fn list_collection_ids( &self, database: &str, parent: &ResourcePath, at: ReadTime, ) -> Vec<String>
IDs of the collections directly under
parent that contain at least one document at
any depth, in UTF-8 order.Source§fn commit(
&self,
database: &str,
write: &mut dyn FnMut(&mut dyn WriteBatch) -> Result<(), StoreError>,
) -> Result<Commit, StoreError>
fn commit( &self, database: &str, write: &mut dyn FnMut(&mut dyn WriteBatch) -> Result<(), StoreError>, ) -> Result<Commit, StoreError>
Runs
write as one atomic commit.Source§fn clear_database(&self, database: &str) -> ReadTime
fn clear_database(&self, database: &str) -> ReadTime
Drops every document of
database and every older version, at a time after its last
commit, which it returns: later commits are later still, so listeners can order the
clear among them.Source§fn database_names(&self) -> Vec<String>
fn database_names(&self) -> Vec<String>
The databases that hold or held documents.
Source§fn scan_collection(
&self,
database: &str,
collection: &ResourcePath,
at: ReadTime,
visit: &mut Visit<'_>,
)
fn scan_collection( &self, database: &str, collection: &ResourcePath, at: ReadTime, visit: &mut Visit<'_>, )
The documents directly in
collection (not in its subcollections).Auto Trait Implementations§
impl !Freeze for MemoryStore
impl !RefUnwindSafe for MemoryStore
impl !UnwindSafe for MemoryStore
impl Send for MemoryStore
impl Sync for MemoryStore
impl Unpin for MemoryStore
impl UnsafeUnpin for MemoryStore
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