pub struct FileStateStore { /* private fields */ }Expand description
Append-only JSONL state store. Each entry is written to a file named after its id under the configured directory.
Concurrency: per-id writes are serialized via a parking_lot::Mutex
over the id. Different ids can write in parallel.
Implementations§
Trait Implementations§
Source§impl Debug for FileStateStore
impl Debug for FileStateStore
Source§impl StateStore for FileStateStore
impl StateStore for FileStateStore
Source§fn append(
&self,
entry: PortValue,
) -> Pin<Box<dyn Future<Output = Result<PortId, SdkError>> + Send + '_>>
fn append( &self, entry: PortValue, ) -> Pin<Box<dyn Future<Output = Result<PortId, SdkError>> + Send + '_>>
Persist an entry. Returns the assigned identifier.
Source§fn load(
&self,
id: &PortId,
) -> Pin<Box<dyn Future<Output = Result<Option<PortValue>, SdkError>> + Send + '_>>
fn load( &self, id: &PortId, ) -> Pin<Box<dyn Future<Output = Result<Option<PortValue>, SdkError>> + Send + '_>>
Load an entry by id.
Source§fn list(
&self,
prefix: &str,
) -> Pin<Box<dyn Future<Output = Result<Vec<PortId>, SdkError>> + Send + '_>>
fn list( &self, prefix: &str, ) -> Pin<Box<dyn Future<Output = Result<Vec<PortId>, SdkError>> + Send + '_>>
List all entry ids matching the given prefix (e.g.
"session:").Auto Trait Implementations§
impl !Freeze for FileStateStore
impl !RefUnwindSafe for FileStateStore
impl !UnwindSafe for FileStateStore
impl Send for FileStateStore
impl Sync for FileStateStore
impl Unpin for FileStateStore
impl UnsafeUnpin for FileStateStore
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