pub enum ConcreteStateManager {
Memory(MemoryStateManager),
Filesystem(FilesystemStateManager),
}Expand description
Concrete enum to wrap StateManager implementations This allows using StateManager without dyn (which isn’t object-safe due to generic methods)
Variants§
Memory(MemoryStateManager)
Filesystem(FilesystemStateManager)
Implementations§
Source§impl ConcreteStateManager
impl ConcreteStateManager
pub async fn save<T: Serialize + Send + Sync>( &self, node_id: &str, state: &T, ) -> Result<()>
pub async fn save_with_options<T: Serialize + Send + Sync>( &self, node_id: &str, state: &T, options: StateOptions, ) -> Result<()>
pub async fn load<T: DeserializeOwned + Send + Sync>( &self, node_id: &str, ) -> Result<Option<T>>
pub async fn load_versioned<T: DeserializeOwned + Send + Sync>( &self, node_id: &str, ) -> Result<Option<VersionedState<T>>>
pub async fn delete(&self, node_id: &str) -> Result<()>
pub async fn exists(&self, node_id: &str) -> Result<bool>
pub async fn list_nodes(&self) -> Result<Vec<String>>
pub async fn size(&self, node_id: &str) -> Result<Option<usize>>
pub async fn create_snapshot( &self, node_id: &str, description: Option<String>, ) -> Result<StateSnapshot>
pub async fn restore_snapshot(&self, snapshot_id: &str) -> Result<()>
pub async fn list_snapshots(&self, node_id: &str) -> Result<Vec<StateSnapshot>>
pub async fn delete_snapshot(&self, snapshot_id: &str) -> Result<()>
pub async fn compare_and_swap<T: Serialize + DeserializeOwned + Send + Sync>( &self, node_id: &str, expected: &T, new_value: &T, ) -> Result<bool>
Trait Implementations§
Source§impl Clone for ConcreteStateManager
impl Clone for ConcreteStateManager
Source§fn clone(&self) -> ConcreteStateManager
fn clone(&self) -> ConcreteStateManager
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 moreAuto Trait Implementations§
impl Freeze for ConcreteStateManager
impl !RefUnwindSafe for ConcreteStateManager
impl Send for ConcreteStateManager
impl Sync for ConcreteStateManager
impl Unpin for ConcreteStateManager
impl !UnwindSafe for ConcreteStateManager
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