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
impl Storage for OpStorage
Source§fn clear(&self)
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)
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>
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 scan<'s>(
&'s self,
prefix: &str,
) -> Box<dyn Iterator<Item = (Box<str>, StorageValue)> + 's>
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 moreAuto Trait Implementations§
impl Freeze for OpStorage
impl !RefUnwindSafe for OpStorage
impl !Send for OpStorage
impl !Sync for OpStorage
impl Unpin for OpStorage
impl UnsafeUnpin for OpStorage
impl !UnwindSafe for OpStorage
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