Skip to main content

BlockingStore

Struct BlockingStore 

Source
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

Source

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.

Source

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.

Source

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.

Source

pub fn append( &self, stream: &StreamId, kind: &str, patch: Patch, meta: Value, ) -> Result<Seq, StoreError>

Source

pub fn import_event( &self, stream: &StreamId, kind: &str, patch: Patch, meta: Value, at: Timestamp, ) -> Result<Seq, StoreError>

Source

pub fn state(&self, stream: &StreamId) -> Result<Value, StoreError>

Source

pub fn state_at(&self, stream: &StreamId, at: Seq) -> Result<Value, StoreError>

Source

pub fn revert(&self, stream: &StreamId, to: Seq) -> Result<Seq, StoreError>

Source

pub fn read( &self, stream: &StreamId, from: Seq, limit: usize, ) -> Result<Vec<Event>, StoreError>

Source

pub fn read_by_meta( &self, stream: &StreamId, field: &str, value: &Value, from: Seq, limit: usize, ) -> Result<Vec<Event>, StoreError>

Source

pub fn head(&self, stream: &StreamId) -> Result<Option<Seq>, StoreError>

Source

pub fn seq_at_time( &self, stream: &StreamId, at: Timestamp, ) -> Result<Option<Seq>, StoreError>

Source

pub fn streams(&self) -> Result<Vec<StreamId>, StoreError>

Source

pub fn label_set( &self, stream: &StreamId, label: &Label, at: Seq, ) -> Result<(), StoreError>

Source

pub fn label_resolve( &self, stream: &StreamId, label: &Label, ) -> Result<Seq, StoreError>

Source

pub fn labels(&self, stream: &StreamId) -> Result<Vec<(Label, Seq)>, StoreError>

Source

pub fn label_delete( &self, stream: &StreamId, label: &Label, ) -> Result<bool, StoreError>

Source

pub fn materialize_to_sink( &self, stream: &StreamId, sink_id: &str, at: Option<Seq>, ) -> Result<Seq, StoreError>

Source

pub fn catch_up(&self, sink_id: &str) -> Result<CatchUpReport, StoreError>

Source

pub fn rebuild(&self, sink_id: &str) -> Result<CatchUpReport, StoreError>

Trait Implementations§

Source§

impl Clone for BlockingStore

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.