Skip to main content

MemoryStore

Struct MemoryStore 

Source
pub struct MemoryStore { /* private fields */ }

Implementations§

Source§

impl MemoryStore

Source

pub fn new() -> Self

Trait Implementations§

Source§

impl Clone for MemoryStore

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
Source§

impl Debug for MemoryStore

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for MemoryStore

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl RecordingStore for MemoryStore

Source§

fn finalize(&mut self, node: Node) -> Result<()>

Source§

fn revision(&self) -> Option<u64>

Revision covering every store mutation, or None for externally writable stores.
Source§

fn trusted_immutable_identity(&self) -> bool

Existing settled identity/result bytes cannot change through this backend.
Source§

fn stage_pending(&mut self, node: Node) -> Result<()>

Stage a live call before dispatch. Append-only backends may keep this transient and publish a single completed record during finalization.
Source§

fn cache_revision(&self) -> Option<StoreRevision>

A token valid only on this store instance. Returning Some promises that every committed mutation changes a component and that reads observe the current token. Local writes preserve settled identity/result bytes; other changes, including external SQL and triggers, must change external. A single-node write must not modify other cached nodes; such side effects require changing external or returning None instead. Runtimes recheck tokens after scans and discard caches on any change.
Source§

fn ancestry_snapshot(&self, _id: &str) -> Result<Option<Vec<Node>>>

Return a detached, consistent read of the requested node followed by all ancestors, ending at a root. All payload blobs must share that snapshot. None means the backend cannot provide a snapshot; runtime verification then retains its fail-closed behavior under sustained concurrent changes.
Source§

fn subtree_snapshot(&self, _root: &str) -> Result<Option<Vec<Node>>>

Return a detached, consistent read of the complete subtree rooted here, with the requested root first and each parent preceding its children. The root’s external ancestry must also be verified in the same snapshot. Snapshot reads must not leave a transaction open after success or failure.
Source§

fn supports_reservations(&self) -> bool

Source§

fn reserve_budget( &mut self, _id: &str, _budgets: &[BudgetReservation], _windows: &[WindowReservation], _lease_seconds: f64, ) -> Result<Option<ReservationCheck>>

None means this backend has no shared-budget arbiter.
Source§

fn settle_budget( &mut self, _id: &str, _charges: &BTreeMap<String, Decimal>, ) -> Result<()>

Source§

fn release_budget(&mut self, _id: &str) -> Result<()>

Source§

fn lease_renewer(&self) -> Option<LeaseRenewer>

An independent connection-safe heartbeat, callable while a handler executes.
Source§

impl Store for MemoryStore

Source§

fn put(&mut self, node: Node) -> Result<()>

Source§

fn get(&self, id: &str) -> Result<Node>

Source§

fn exists(&self, id: &str) -> bool

Source§

fn children(&self, id: &str) -> Result<Vec<String>>

Source§

fn update_meta(&mut self, id: &str, patch: Value) -> Result<()>

Source§

fn roots(&self) -> Result<Vec<String>>

Source§

fn apply_batch( &mut self, nodes: Vec<Node>, patches: Vec<(String, Value)>, ) -> Result<()>

Apply a prevalidated batch. Backends may override to provide atomicity.
Source§

fn drop_nodes(&mut self, ids: &BTreeSet<String>) -> Result<()>

Source§

fn compact(&mut self) -> Result<usize>

Source§

fn operation_log(&self) -> Result<Vec<u8>>

Snapshot compatible append-only log bytes, when the backend exposes one.
Source§

fn try_exists(&self, id: &str) -> Result<bool>

Fallible existence query. Runtime dispatch must use this method so a remote connection failure cannot be mistaken for a missing recording.
Source§

fn import_nodes(&mut self, nodes: Vec<Node>) -> Result<(usize, usize)>

Import collision checks and writes share one transaction on native stores.
Source§

fn merge_nodes(&mut self, nodes: Vec<Node>, replay: bool) -> Result<MergeReport>

Merge destination reads and writes share one transaction on SQLite.
Source§

fn walk(&self, root: &str) -> Result<Vec<Node>>

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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

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> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
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 = !

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

fn try_from(value: U) -> Result<T, !>

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.