pub struct BlockingStore { /* private fields */ }Expand description
Synchronous mirror of Store.
Cheap to clone: only the inner Store handle is Arc-shared. The runtime
driver is shared through Arc as well, so cloned handles all drive the
same runtime.
Implementations§
Source§impl BlockingStore
impl BlockingStore
Sourcepub fn new(store: Store) -> Result<Self>
pub fn new(store: Store) -> Result<Self>
Build a BlockingStore that owns a dedicated current_thread tokio
runtime.
Fails only if the runtime cannot be constructed (rare — typically an exhausted file descriptor budget). See the crate-level docs for the nested-runtime pitfall.
Sourcepub fn with_handle(store: Store, handle: Handle) -> Self
pub fn with_handle(store: Store, handle: Handle) -> Self
Build a BlockingStore that drives calls on the caller’s runtime,
identified by a Handle.
Prefer this constructor when the surrounding process already owns a tokio runtime — reusing the handle avoids spawning a second one.
Sourcepub fn as_async(&self) -> &Store
pub fn as_async(&self) -> &Store
Access the underlying async Store. Useful when a caller needs to
mix async and blocking paths, or hand the async handle to a
concurrently-running task.
Sourcepub fn append(
&self,
stream: &StreamId,
kind: &str,
patch: Patch,
meta: Value,
) -> Result<Seq, StoreError>
pub fn append( &self, stream: &StreamId, kind: &str, patch: Patch, meta: Value, ) -> Result<Seq, StoreError>
See Store::append.
Sourcepub fn import_event(
&self,
stream: &StreamId,
kind: &str,
patch: Patch,
meta: Value,
at: Timestamp,
) -> Result<Seq, StoreError>
pub fn import_event( &self, stream: &StreamId, kind: &str, patch: Patch, meta: Value, at: Timestamp, ) -> Result<Seq, StoreError>
See Store::import_event.
Sourcepub fn state(&self, stream: &StreamId) -> Result<Value, StoreError>
pub fn state(&self, stream: &StreamId) -> Result<Value, StoreError>
See Store::state.
Sourcepub fn state_at(&self, stream: &StreamId, at: Seq) -> Result<Value, StoreError>
pub fn state_at(&self, stream: &StreamId, at: Seq) -> Result<Value, StoreError>
See Store::state_at.
Sourcepub fn revert(&self, stream: &StreamId, to: Seq) -> Result<Seq, StoreError>
pub fn revert(&self, stream: &StreamId, to: Seq) -> Result<Seq, StoreError>
See Store::revert.
Sourcepub fn read(
&self,
stream: &StreamId,
from: Seq,
limit: usize,
) -> Result<Vec<Event>, StoreError>
pub fn read( &self, stream: &StreamId, from: Seq, limit: usize, ) -> Result<Vec<Event>, StoreError>
See Store::read.
Sourcepub fn read_by_meta(
&self,
stream: &StreamId,
field: &str,
value: &Value,
from: Seq,
limit: usize,
) -> Result<Vec<Event>, StoreError>
pub fn read_by_meta( &self, stream: &StreamId, field: &str, value: &Value, from: Seq, limit: usize, ) -> Result<Vec<Event>, StoreError>
See Store::read_by_meta.
Sourcepub fn head(&self, stream: &StreamId) -> Result<Option<Seq>, StoreError>
pub fn head(&self, stream: &StreamId) -> Result<Option<Seq>, StoreError>
See Store::head.
Sourcepub fn seq_at_time(
&self,
stream: &StreamId,
at: Timestamp,
) -> Result<Option<Seq>, StoreError>
pub fn seq_at_time( &self, stream: &StreamId, at: Timestamp, ) -> Result<Option<Seq>, StoreError>
See Store::seq_at_time.
Sourcepub fn streams(&self) -> Result<Vec<StreamId>, StoreError>
pub fn streams(&self) -> Result<Vec<StreamId>, StoreError>
See Store::streams.
Sourcepub fn label_set(
&self,
stream: &StreamId,
label: &Label,
at: Seq,
) -> Result<(), StoreError>
pub fn label_set( &self, stream: &StreamId, label: &Label, at: Seq, ) -> Result<(), StoreError>
See Store::label_set.
Sourcepub fn label_resolve(
&self,
stream: &StreamId,
label: &Label,
) -> Result<Seq, StoreError>
pub fn label_resolve( &self, stream: &StreamId, label: &Label, ) -> Result<Seq, StoreError>
See Store::label_resolve.
Sourcepub fn labels(&self, stream: &StreamId) -> Result<Vec<(Label, Seq)>, StoreError>
pub fn labels(&self, stream: &StreamId) -> Result<Vec<(Label, Seq)>, StoreError>
See Store::labels.
Sourcepub fn label_delete(
&self,
stream: &StreamId,
label: &Label,
) -> Result<bool, StoreError>
pub fn label_delete( &self, stream: &StreamId, label: &Label, ) -> Result<bool, StoreError>
See Store::label_delete.
Sourcepub fn materialize_to_sink(
&self,
stream: &StreamId,
sink_id: &str,
at: Option<Seq>,
) -> Result<Seq, StoreError>
pub fn materialize_to_sink( &self, stream: &StreamId, sink_id: &str, at: Option<Seq>, ) -> Result<Seq, StoreError>
Sourcepub fn catch_up(&self, sink_id: &str) -> Result<CatchUpReport, StoreError>
pub fn catch_up(&self, sink_id: &str) -> Result<CatchUpReport, StoreError>
See Store::catch_up.
Sourcepub fn rebuild(&self, sink_id: &str) -> Result<CatchUpReport, StoreError>
pub fn rebuild(&self, sink_id: &str) -> Result<CatchUpReport, StoreError>
See Store::rebuild.