pub enum SelectedMemoryStore {
Local(LocalMemoryStore),
Remote(RemoteMemoryClient),
}Expand description
Runtime-selected local-or-remote memory backend.
Variants§
Local(LocalMemoryStore)
Private local SQLite storage.
Remote(RemoteMemoryClient)
Authenticated namespaced HTTP storage.
Implementations§
Source§impl SelectedMemoryStore
impl SelectedMemoryStore
Sourcepub const fn remote(client: RemoteMemoryClient) -> Self
pub const fn remote(client: RemoteMemoryClient) -> Self
Selects an authenticated remote HTTP backend.
Sourcepub const fn source(&self) -> MemorySource
pub const fn source(&self) -> MemorySource
Returns the selected backend kind without performing I/O.
Sourcepub async fn access(&self) -> Result<MemoryAccess, MemoryError>
pub async fn access(&self) -> Result<MemoryAccess, MemoryError>
Returns backend provenance and negotiated remote authorization.
Trait Implementations§
Source§impl Clone for SelectedMemoryStore
impl Clone for SelectedMemoryStore
Source§fn clone(&self) -> SelectedMemoryStore
fn clone(&self) -> SelectedMemoryStore
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SelectedMemoryStore
impl Debug for SelectedMemoryStore
Source§impl MemoryStore for SelectedMemoryStore
Available on crate features client and local only.
impl MemoryStore for SelectedMemoryStore
Available on crate features
client and local only.Source§fn scan(
&self,
query: &str,
limit: usize,
) -> impl Future<Output = Result<MemoryScan, MemoryError>> + Send
fn scan( &self, query: &str, limit: usize, ) -> impl Future<Output = Result<MemoryScan, MemoryError>> + Send
Searches visible records and records scan telemetry.
Source§fn read(
&self,
ids: &[i64],
keys: &[MemoryKey],
) -> impl Future<Output = Result<Vec<MemoryRecord>, MemoryError>> + Send
fn read( &self, ids: &[i64], keys: &[MemoryKey], ) -> impl Future<Output = Result<Vec<MemoryRecord>, MemoryError>> + Send
Reads unversioned IDs and versioned keys, recording use telemetry.
Source§fn list(
&self,
) -> impl Future<Output = Result<Vec<MemoryRecord>, MemoryError>> + Send
fn list( &self, ) -> impl Future<Output = Result<Vec<MemoryRecord>, MemoryError>> + Send
Lists a deterministic window that excludes expired probationary records. Read more
Source§fn put(
&self,
content: &str,
replacement: Option<MemoryKey>,
) -> impl Future<Output = Result<MemoryRecord, MemoryError>> + Send
fn put( &self, content: &str, replacement: Option<MemoryKey>, ) -> impl Future<Output = Result<MemoryRecord, MemoryError>> + Send
Inserts content or compare-and-swap replaces
replacement.Source§fn delete(
&self,
key: MemoryKey,
) -> impl Future<Output = Result<(), MemoryError>> + Send
fn delete( &self, key: MemoryKey, ) -> impl Future<Output = Result<(), MemoryError>> + Send
Compare-and-swap deletes
key. Read moreSource§fn sync(
&self,
memories: &[MemoryRecord],
) -> impl Future<Output = Result<SyncReport, MemoryError>> + Send
fn sync( &self, memories: &[MemoryRecord], ) -> impl Future<Output = Result<SyncReport, MemoryError>> + Send
Atomically applies an authoritative full snapshot to the owned namespace. Read more
Source§fn export_page(
&self,
namespaces: Option<&[String]>,
cursor: Option<&ExportCursor>,
limit: usize,
) -> impl Future<Output = Result<(Vec<MemoryRecord>, Option<ExportCursor>), MemoryError>> + Send
fn export_page( &self, namespaces: Option<&[String]>, cursor: Option<&ExportCursor>, limit: usize, ) -> impl Future<Output = Result<(Vec<MemoryRecord>, Option<ExportCursor>), MemoryError>> + Send
Source§fn export_all(
&self,
namespaces: Option<&[String]>,
) -> impl Future<Output = Result<Vec<MemoryRecord>, MemoryError>> + Send
fn export_all( &self, namespaces: Option<&[String]>, ) -> impl Future<Output = Result<Vec<MemoryRecord>, MemoryError>> + Send
Collects a complete bounded export through the paginated storage contract. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for SelectedMemoryStore
impl !UnwindSafe for SelectedMemoryStore
impl Freeze for SelectedMemoryStore
impl Send for SelectedMemoryStore
impl Sync for SelectedMemoryStore
impl Unpin for SelectedMemoryStore
impl UnsafeUnpin for SelectedMemoryStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.