pub struct ThreadSafeStorage { /* private fields */ }Expand description
Thread-safe wrapper around any CheckpointStorage
Implementations§
Source§impl ThreadSafeStorage
impl ThreadSafeStorage
Sourcepub fn new<S: CheckpointStorage + 'static>(storage: S) -> Self
pub fn new<S: CheckpointStorage + 'static>(storage: S) -> Self
Create from existing storage
Sourcepub fn store(&self, checkpoint: &TemporalCheckpoint) -> Result<()>
pub fn store(&self, checkpoint: &TemporalCheckpoint) -> Result<()>
Store a checkpoint
Sourcepub fn get(&self, id: CheckpointId) -> Result<TemporalCheckpoint>
pub fn get(&self, id: CheckpointId) -> Result<TemporalCheckpoint>
Get checkpoint by ID
Sourcepub fn get_latest(
&self,
session_id: SessionId,
) -> Result<Option<TemporalCheckpoint>>
pub fn get_latest( &self, session_id: SessionId, ) -> Result<Option<TemporalCheckpoint>>
Get latest checkpoint for session
Sourcepub fn list_by_session(
&self,
session_id: SessionId,
) -> Result<Vec<CheckpointSummary>>
pub fn list_by_session( &self, session_id: SessionId, ) -> Result<Vec<CheckpointSummary>>
List checkpoints by session
Sourcepub fn list_by_tag(&self, tag: &str) -> Result<Vec<CheckpointSummary>>
pub fn list_by_tag(&self, tag: &str) -> Result<Vec<CheckpointSummary>>
List checkpoints by tag
Sourcepub fn delete(&self, id: CheckpointId) -> Result<()>
pub fn delete(&self, id: CheckpointId) -> Result<()>
Delete checkpoint
Sourcepub fn get_max_sequence(&self) -> Result<u64>
pub fn get_max_sequence(&self) -> Result<u64>
Get maximum sequence number across all checkpoints
Trait Implementations§
Source§impl Clone for ThreadSafeStorage
impl Clone for ThreadSafeStorage
impl Send for ThreadSafeStorage
impl Sync for ThreadSafeStorage
Auto Trait Implementations§
impl Freeze for ThreadSafeStorage
impl RefUnwindSafe for ThreadSafeStorage
impl Unpin for ThreadSafeStorage
impl UnsafeUnpin for ThreadSafeStorage
impl UnwindSafe for ThreadSafeStorage
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