pub struct ReferenceSubstrate { /* private fields */ }Implementations§
Source§impl ReferenceSubstrate
impl ReferenceSubstrate
pub fn new() -> Self
pub fn set_capabilities(&mut self, caps: Capabilities)
Sourcepub fn register_fork(&mut self, entity: &str, heads: &[&str])
pub fn register_fork(&mut self, entity: &str, heads: &[&str])
Register a fork (turns on the forks capability).
Sourcepub fn set_telemetry(&mut self, view: TelemetryView)
pub fn set_telemetry(&mut self, view: TelemetryView)
Inject a telemetry snapshot (turns on the telemetry capability).
Sourcepub fn insert(&mut self, record: GrainRecord) -> String
pub fn insert(&mut self, record: GrainRecord) -> String
Insert a fully-formed grain record; returns its assigned hash.
Trait Implementations§
Source§impl Default for ReferenceSubstrate
impl Default for ReferenceSubstrate
Source§fn default() -> ReferenceSubstrate
fn default() -> ReferenceSubstrate
Returns the “default value” for a type. Read more
Source§impl OmsSubstrate for ReferenceSubstrate
impl OmsSubstrate for ReferenceSubstrate
Source§fn put_grain(&mut self, spec: &GrainSpec) -> Result<String>
fn put_grain(&mut self, spec: &GrainSpec) -> Result<String>
Append a new grain; returns its content address.
Source§fn supersede(
&mut self,
target_hash: &str,
spec: &GrainSpec,
_justification: &str,
) -> Result<String>
fn supersede( &mut self, target_hash: &str, spec: &GrainSpec, _justification: &str, ) -> Result<String>
Supersede
target_hash with a new grain carrying justification;
returns the new grain’s address. Atomic and distinct from put
(OMS §28.4).Source§fn retract(&mut self, hash: &str, reason: &str) -> Result<()>
fn retract(&mut self, hash: &str, reason: &str) -> Result<()>
Index-layer retraction (
verification_status = retracted) — the
inverse of an applied ADD, used by rollback. Not destructive (the grain
stays content-addressed; only the index marks it retracted). The
default reports it unsupported so substrates opt in.Source§fn execute_cal(&mut self, cal: &str) -> Result<Vec<Value>>
fn execute_cal(&mut self, cal: &str) -> Result<Vec<Value>>
Execute CAL text, returning result rows as JSON. Used to regenerate
evidence sets (
evidence_query) and to apply proposal_cal. A
substrate MAY reject CAL it cannot run with Error::CalUnsupported.Source§fn validate_cal(&self, cal: &str) -> Result<()>
fn validate_cal(&self, cal: &str) -> Result<()>
Validate a CAL batch without executing it (statement classification,
destructive-op detection). Delegated to the substrate — the engine
contains a CAL writer, never a parser.
Source§fn load_state(&self) -> Result<Value>
fn load_state(&self) -> Result<Value>
Load the persisted loop state blob (config + watermarks/cooldowns).
Returns
Value::Null when nothing has been stored yet.Source§fn store_state(&mut self, state: &Value) -> Result<()>
fn store_state(&mut self, state: &Value) -> Result<()>
Persist the loop state blob (a file-truth, so it travels with the
file on sync).
Source§fn put_blob(&mut self, bytes: &[u8]) -> Result<String>
fn put_blob(&mut self, bytes: &[u8]) -> Result<String>
Store an opaque blob (candidate tool CODE, evalset payloads) in the
substrate’s CAS, returning its address. §7.4’s blob seam —
CAPABILITY-GATED: the default refuses, so a loop can only carry code
on substrates that explicitly opt in. Code enters the substrate only
through this seam or an authored add — never from a git mirror.
Source§impl SubstrateRead for ReferenceSubstrate
impl SubstrateRead for ReferenceSubstrate
Source§fn capabilities(&self) -> Capabilities
fn capabilities(&self) -> Capabilities
Declared optional capabilities.
Source§fn grains_of_type(
&self,
grain_type: &str,
namespace: Option<&str>,
opts: ReadOpts,
) -> Result<Vec<GrainRecord>>
fn grains_of_type( &self, grain_type: &str, namespace: Option<&str>, opts: ReadOpts, ) -> Result<Vec<GrainRecord>>
Curated read: all grains of one OMS type, optionally namespace-scoped
and watermark/liveness filtered.
Source§fn grain(&self, hash: &str) -> Result<Option<GrainRecord>>
fn grain(&self, hash: &str) -> Result<Option<GrainRecord>>
Fetch one grain by content address.
Auto Trait Implementations§
impl Freeze for ReferenceSubstrate
impl RefUnwindSafe for ReferenceSubstrate
impl Send for ReferenceSubstrate
impl Sync for ReferenceSubstrate
impl Unpin for ReferenceSubstrate
impl UnsafeUnpin for ReferenceSubstrate
impl UnwindSafe for ReferenceSubstrate
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