Rindle docs and package mapSkip to main content

OpStorage

Struct OpStorage 

Source
pub struct OpStorage { /* private fields */ }
Expand description

One operator’s namespaced scratch map inside the shared SQLite storage table, keyed by this operator’s unique op_id.

Trait Implementations§

Source§

impl Storage for OpStorage

Source§

fn clear(&self)

Drop this operator’s whole namespace in one DELETE (the [Storage::clear] fast path used by pipeline teardown), rather than the default per-key scan+del. op_ids are never reused, so this only reclaims disk — a rebuilt operator gets a fresh op_id and so an already-empty keyspace.

Unlike the point ops, clear does NOT gate on maybe_checkpoint: a bulk delete only shrinks the open transaction (it runs in the standing BEGIN), so there is no checkpoint-failure path that could leave rows behind. Only the DELETE itself can fail, and it parks like the others.

Source§

fn set(&self, key: &str, value: StorageValue)

Insert or overwrite key’s value (spec 10 §3.1, E3).
Source§

fn get(&self, key: &str) -> Option<StorageValue>

Owned lookup. None if absent (E1). The JS get(key, def) default is a caller concern — use get(k).unwrap_or(default) (spec 10 §6 deviation D1); we do not bake it into the signature. The returned value is owned (never a borrow into the store), so the operator may hold/mutate it past a later set regardless of backend (spec 10 §3.2 inv.3, E11).
Source§

fn del(&self, key: &str)

Remove key. No-op if absent (E4).
Source§

fn scan<'s>( &'s self, prefix: &str, ) -> Box<dyn Iterator<Item = (Box<str>, StorageValue)> + 's>

Ascending prefix scan. Yields owned (key, value) pairs in byte-ascending key order, starting at the first key >= prefix and stopping at the first key not starting with prefix (spec 10 §3.2). prefix == "" scans the whole keyspace in order (E5/E7). Read more

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<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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

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

§

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

§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,