pub struct MockDocumentStore<T> { /* private fields */ }Expand description
Deterministic offline document adapter used directly or by remote drivers.
Implementations§
Source§impl<T> MockDocumentStore<T>
impl<T> MockDocumentStore<T>
Sourcepub const fn capabilities() -> BackendCapabilities
pub const fn capabilities() -> BackendCapabilities
Declares the adapter’s bounded behavior.
Trait Implementations§
Source§impl<T> Clone for MockDocumentStore<T>
impl<T> Clone for MockDocumentStore<T>
Source§impl<T> Default for MockDocumentStore<T>
impl<T> Default for MockDocumentStore<T>
Source§impl<T> DocumentInventory<T> for MockDocumentStore<T>
impl<T> DocumentInventory<T> for MockDocumentStore<T>
Source§fn list_entries<'life0, 'life1, 'async_trait>(
&'life0 self,
collection: &'life1 CollectionName,
page: DocumentPage,
) -> Pin<Box<dyn Future<Output = Result<Vec<DocumentEntry<T>>, PolyglotError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list_entries<'life0, 'life1, 'async_trait>(
&'life0 self,
collection: &'life1 CollectionName,
page: DocumentPage,
) -> Pin<Box<dyn Future<Output = Result<Vec<DocumentEntry<T>>, PolyglotError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Lists one bounded page with each portable identifier retained.
Source§impl<T> DocumentRepository<T> for MockDocumentStore<T>
impl<T> DocumentRepository<T> for MockDocumentStore<T>
Source§fn create<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
collection: &'life1 CollectionName,
id: &'life2 DocumentId,
entity: &'life3 T,
) -> Pin<Box<dyn Future<Output = Result<(), PolyglotError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn create<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
collection: &'life1 CollectionName,
id: &'life2 DocumentId,
entity: &'life3 T,
) -> Pin<Box<dyn Future<Output = Result<(), PolyglotError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Creates a document and fails on an existing identifier.
Source§fn find<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 CollectionName,
id: &'life2 DocumentId,
) -> Pin<Box<dyn Future<Output = Result<Option<T>, PolyglotError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn find<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 CollectionName,
id: &'life2 DocumentId,
) -> Pin<Box<dyn Future<Output = Result<Option<T>, PolyglotError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Finds one document by its portable identifier.
Source§fn replace<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
collection: &'life1 CollectionName,
id: &'life2 DocumentId,
entity: &'life3 T,
) -> Pin<Box<dyn Future<Output = Result<(), PolyglotError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn replace<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
collection: &'life1 CollectionName,
id: &'life2 DocumentId,
entity: &'life3 T,
) -> Pin<Box<dyn Future<Output = Result<(), PolyglotError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Replaces an existing document and fails if it does not exist.
Source§fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 CollectionName,
id: &'life2 DocumentId,
) -> Pin<Box<dyn Future<Output = Result<bool, PolyglotError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
collection: &'life1 CollectionName,
id: &'life2 DocumentId,
) -> Pin<Box<dyn Future<Output = Result<bool, PolyglotError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Deletes a document, returning whether it existed.
Source§fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
collection: &'life1 CollectionName,
page: DocumentPage,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>, PolyglotError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn list<'life0, 'life1, 'async_trait>(
&'life0 self,
collection: &'life1 CollectionName,
page: DocumentPage,
) -> Pin<Box<dyn Future<Output = Result<Vec<T>, PolyglotError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Lists a deterministic, bounded page ordered by document identifier.
Auto Trait Implementations§
impl<T> !RefUnwindSafe for MockDocumentStore<T>
impl<T> !UnwindSafe for MockDocumentStore<T>
impl<T> Freeze for MockDocumentStore<T>
impl<T> Send for MockDocumentStore<T>
impl<T> Sync for MockDocumentStore<T>
impl<T> Unpin for MockDocumentStore<T>
impl<T> UnsafeUnpin for MockDocumentStore<T>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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> ⓘ
Converts
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> ⓘ
Converts
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