pub struct Memory<S> { /* private fields */ }
Expand description
An in-memory Stash that is backed by another Stash but serves read requests from its memory. Write requests are propogated to the other Stash.
Implementations
Trait Implementations
sourceimpl<S: Append> Append for Memory<S>
impl<S: Append> Append for Memory<S>
sourcefn append<'life0, 'async_trait, I>(
&'life0 mut self,
batches: I
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
I: IntoIterator<Item = AppendBatch> + Send + 'static,
I::IntoIter: Send,
I: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn append<'life0, 'async_trait, I>(
&'life0 mut self,
batches: I
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
I: IntoIterator<Item = AppendBatch> + Send + 'static,
I::IntoIter: Send,
I: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Atomically adds entries, seals, and compacts multiple collections. Read more
sourceimpl<S: Stash> Stash for Memory<S>
impl<S: Stash> Stash for Memory<S>
sourcefn collection<'life0, 'life1, 'async_trait, K, V>(
&'life0 mut self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<StashCollection<K, V>, StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn collection<'life0, 'life1, 'async_trait, K, V>(
&'life0 mut self,
name: &'life1 str
) -> Pin<Box<dyn Future<Output = Result<StashCollection<K, V>, StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Loads or creates the named collection. Read more
sourcefn iter<'life0, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>
) -> Pin<Box<dyn Future<Output = Result<Vec<((K, V), Timestamp, Diff)>, StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn iter<'life0, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>
) -> Pin<Box<dyn Future<Output = Result<Vec<((K, V), Timestamp, Diff)>, StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Iterates over all entries in the stash. Read more
sourcefn iter_key<'life0, 'life1, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>,
key: &'life1 K
) -> Pin<Box<dyn Future<Output = Result<Vec<(V, Timestamp, Diff)>, StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn iter_key<'life0, 'life1, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>,
key: &'life1 K
) -> Pin<Box<dyn Future<Output = Result<Vec<(V, Timestamp, Diff)>, StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Iterates over entries in the stash for the given key. Read more
sourcefn update_many<'life0, 'async_trait, K, V, I>(
&'life0 mut self,
collection: StashCollection<K, V>,
entries: I
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
I: IntoIterator<Item = ((K, V), Timestamp, Diff)> + Send,
I::IntoIter: Send,
K: 'async_trait,
V: 'async_trait,
I: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn update_many<'life0, 'async_trait, K, V, I>(
&'life0 mut self,
collection: StashCollection<K, V>,
entries: I
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
I: IntoIterator<Item = ((K, V), Timestamp, Diff)> + Send,
I::IntoIter: Send,
K: 'async_trait,
V: 'async_trait,
I: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Atomically adds multiple entries to the arrangement. Read more
sourcefn seal<'life0, 'life1, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>,
new_upper: AntichainRef<'life1, Timestamp>
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn seal<'life0, 'life1, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>,
new_upper: AntichainRef<'life1, Timestamp>
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Atomically advances the upper frontier to the specified value. Read more
sourcefn seal_batch<'life0, 'life1, 'async_trait, K, V>(
&'life0 mut self,
seals: &'life1 [(StashCollection<K, V>, Antichain<Timestamp>)]
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn seal_batch<'life0, 'life1, 'async_trait, K, V>(
&'life0 mut self,
seals: &'life1 [(StashCollection<K, V>, Antichain<Timestamp>)]
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Performs multiple seals at once, potentially in a more performant way than performing the individual seals one by one. Read more
sourcefn compact<'a, 'async_trait, K, V>(
&'a mut self,
collection: StashCollection<K, V>,
new_since: AntichainRef<'a, Timestamp>
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
'a: 'async_trait,
K: 'async_trait,
V: 'async_trait,
Self: 'async_trait,
fn compact<'a, 'async_trait, K, V>(
&'a mut self,
collection: StashCollection<K, V>,
new_since: AntichainRef<'a, Timestamp>
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
'a: 'async_trait,
K: 'async_trait,
V: 'async_trait,
Self: 'async_trait,
Atomically advances the since frontier to the specified value. Read more
sourcefn compact_batch<'life0, 'life1, 'async_trait, K, V>(
&'life0 mut self,
compactions: &'life1 [(StashCollection<K, V>, Antichain<Timestamp>)]
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn compact_batch<'life0, 'life1, 'async_trait, K, V>(
&'life0 mut self,
compactions: &'life1 [(StashCollection<K, V>, Antichain<Timestamp>)]
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Performs multiple compactions at once, potentially in a more performant way than performing the individual compactions one by one. Read more
sourcefn consolidate<'a, 'async_trait, K, V>(
&'a mut self,
collection: StashCollection<K, V>
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
'a: 'async_trait,
K: 'async_trait,
V: 'async_trait,
Self: 'async_trait,
fn consolidate<'a, 'async_trait, K, V>(
&'a mut self,
collection: StashCollection<K, V>
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
'a: 'async_trait,
K: 'async_trait,
V: 'async_trait,
Self: 'async_trait,
Atomically consolidates entries less than the since frontier. Read more
sourcefn consolidate_batch<'life0, 'life1, 'async_trait, K, V>(
&'life0 mut self,
collections: &'life1 [StashCollection<K, V>]
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn consolidate_batch<'life0, 'life1, 'async_trait, K, V>(
&'life0 mut self,
collections: &'life1 [StashCollection<K, V>]
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Performs multiple consolidations at once, potentially in a more performant way than performing the individual consolidations one by one. Read more
sourcefn since<'life0, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>
) -> Pin<Box<dyn Future<Output = Result<Antichain<Timestamp>, StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn since<'life0, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>
) -> Pin<Box<dyn Future<Output = Result<Antichain<Timestamp>, StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Reports the current since frontier.
sourcefn upper<'life0, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>
) -> Pin<Box<dyn Future<Output = Result<Antichain<Timestamp>, StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn upper<'life0, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>
) -> Pin<Box<dyn Future<Output = Result<Antichain<Timestamp>, StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Reports the current upper frontier.
sourcefn peek_timestamp<'life0, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>
) -> Pin<Box<dyn Future<Output = Result<Timestamp, StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn peek_timestamp<'life0, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>
) -> Pin<Box<dyn Future<Output = Result<Timestamp, StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Returns the most recent timestamp at which sealed entries can be read.
sourcefn peek<'life0, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>
) -> Pin<Box<dyn Future<Output = Result<Vec<(K, V, Diff)>, StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn peek<'life0, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>
) -> Pin<Box<dyn Future<Output = Result<Vec<(K, V, Diff)>, StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Returns the current value of sealed entries. Read more
sourcefn peek_one<'life0, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<K, V>, StashError>> + Send + 'async_trait>> where
K: Data + Hash,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn peek_one<'life0, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>
) -> Pin<Box<dyn Future<Output = Result<BTreeMap<K, V>, StashError>> + Send + 'async_trait>> where
K: Data + Hash,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Returns the current k,v pairs of sealed entries, erroring if there is more than one entry for a given key or the multiplicity is not 1 for each key. Read more
sourcefn peek_key_one<'life0, 'life1, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>,
key: &'life1 K
) -> Pin<Box<dyn Future<Output = Result<Option<V>, StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
fn peek_key_one<'life0, 'life1, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>,
key: &'life1 K
) -> Pin<Box<dyn Future<Output = Result<Option<V>, StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Self: 'async_trait,
Returns the current sealed value for the given key, erroring if there is more than one entry for the key or its multiplicity is not 1. Read more
sourcefn update<'life0, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>,
data: (K, V),
time: Timestamp,
diff: Diff
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn update<'life0, 'async_trait, K, V>(
&'life0 mut self,
collection: StashCollection<K, V>,
data: (K, V),
time: Timestamp,
diff: Diff
) -> Pin<Box<dyn Future<Output = Result<(), StashError>> + Send + 'async_trait>> where
K: Data,
V: Data,
K: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Atomically adds a single entry to the arrangement. Read more
Auto Trait Implementations
impl<S> RefUnwindSafe for Memory<S> where
S: RefUnwindSafe,
impl<S> Send for Memory<S> where
S: Send,
impl<S> Sync for Memory<S> where
S: Sync,
impl<S> Unpin for Memory<S> where
S: Unpin,
impl<S> UnwindSafe for Memory<S> where
S: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> FutureExt for T
impl<T> FutureExt for T
sourcefn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
sourcefn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
sourcefn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message T
in a tonic::Request
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more