pub struct MemoryStorage<T: Chunk = String> { /* private fields */ }
Expand description
A simple in-memory storage implementation.
Great for experimentation and testing.
The storage will use a zero indexed, incremental counter as the key for each node if the node id is not set.
Implementations§
Source§impl<T: Chunk> MemoryStorage<T>
impl<T: Chunk> MemoryStorage<T>
Trait Implementations§
Source§impl<T: Clone + Chunk> Clone for MemoryStorage<T>
impl<T: Clone + Chunk> Clone for MemoryStorage<T>
Source§fn clone(&self) -> MemoryStorage<T>
fn clone(&self) -> MemoryStorage<T>
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 moreSource§impl<T: Default + Chunk> Default for MemoryStorage<T>
impl<T: Default + Chunk> Default for MemoryStorage<T>
Source§fn default() -> MemoryStorage<T>
fn default() -> MemoryStorage<T>
Returns the “default value” for a type. Read more
Source§impl<T: Chunk> Persist for MemoryStorage<T>
impl<T: Chunk> Persist for MemoryStorage<T>
Source§fn store<'life0, 'async_trait>(
&'life0 self,
node: Node<T>,
) -> Pin<Box<dyn Future<Output = Result<Node<T>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn store<'life0, 'async_trait>(
&'life0 self,
node: Node<T>,
) -> Pin<Box<dyn Future<Output = Result<Node<T>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store a node by its id
If the node does not have an id, a simple counter is used as the key.
Source§fn batch_store<'life0, 'async_trait>(
&'life0 self,
nodes: Vec<Node<T>>,
) -> Pin<Box<dyn Future<Output = IndexingStream<T>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn batch_store<'life0, 'async_trait>(
&'life0 self,
nodes: Vec<Node<T>>,
) -> Pin<Box<dyn Future<Output = IndexingStream<T>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Store multiple nodes at once
If a node does not have an id, a simple counter is used as the key.
type Input = T
type Output = T
fn setup<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn batch_size(&self) -> Option<usize>
fn name(&self) -> &'static str
Auto Trait Implementations§
impl<T> Freeze for MemoryStorage<T>
impl<T = String> !RefUnwindSafe for MemoryStorage<T>
impl<T> Send for MemoryStorage<T>
impl<T> Sync for MemoryStorage<T>
impl<T> Unpin for MemoryStorage<T>
impl<T = String> !UnwindSafe for MemoryStorage<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