pub struct LocalHost {
pub staged: usize,
pub committed: usize,
pub published: Vec<String>,
pub query_rows: usize,
pub clock_time: Option<i64>,
pub monotonic_time: u64,
/* private fields */
}Expand description
In-process host: graph/pulse/time in memory, catalog kernels for Animation/etc.
Fields§
§staged: usize§committed: usize§published: Vec<String>§query_rows: usize§clock_time: Option<i64>§monotonic_time: u64Trait Implementations§
Source§impl Host for LocalHost
impl Host for LocalHost
Source§fn time_unix(&mut self, span: Span) -> Result<Value, Diagnostic>
fn time_unix(&mut self, span: Span) -> Result<Value, Diagnostic>
Deterministic epoch for unit tests.
Source§fn time_now(&mut self, span: Span) -> Result<Value, Diagnostic>
fn time_now(&mut self, span: Span) -> Result<Value, Diagnostic>
Returns an Instant from the mock clock (X6).
fn graph_query( &mut self, _args: &[Value], take: u64, _span: Span, ) -> Result<Value, Diagnostic>
fn graph_stage( &mut self, _term: &Value, _span: Span, ) -> Result<Value, Diagnostic>
fn graph_commit(&mut self, _span: Span) -> Result<Value, Diagnostic>
Source§fn graph_begin(&mut self, _span: Span) -> Result<(), Diagnostic>
fn graph_begin(&mut self, _span: Span) -> Result<(), Diagnostic>
Open a transaction. Default is a no-op.
Source§fn graph_abort(&mut self, _span: Span) -> Result<(), Diagnostic>
fn graph_abort(&mut self, _span: Span) -> Result<(), Diagnostic>
Drop uncommitted staged work. Default is a no-op.
Source§fn graph_end(&mut self, span: Span) -> Result<(), Diagnostic>
fn graph_end(&mut self, span: Span) -> Result<(), Diagnostic>
Complete a
transaction { ... } block on normal exit. Read morefn aura_validate( &mut self, node: &Value, shape: &Value, _span: Span, ) -> Result<Value, Diagnostic>
fn pulse_publish( &mut self, topic: &str, _payload: &Value, _span: Span, ) -> Result<Value, Diagnostic>
Source§fn time_unix_nanos(&mut self, span: Span) -> Result<Value, Diagnostic>
fn time_unix_nanos(&mut self, span: Span) -> Result<Value, Diagnostic>
Structured Unix time:
{ secs: I64, nanos: U64 } (T19).
Default calls time_unix and wraps it into a Record.Source§fn time_monotonic_nanos(&mut self, _span: Span) -> Result<Value, Diagnostic>
fn time_monotonic_nanos(&mut self, _span: Span) -> Result<Value, Diagnostic>
Monotonic nanos for frame timing and physics dt (T20).
Default returns 0 (WASM has no monotonic clock until W12 replay Instant).
Source§fn capability_invoke(
&mut self,
id: &str,
args: &Value,
span: Span,
) -> Result<Value, Diagnostic>
fn capability_invoke( &mut self, id: &str, args: &Value, span: Span, ) -> Result<Value, Diagnostic>
Reach an engine capability by id. Default fails closed. Read more
Source§fn available_acceleration(&self) -> AccelerationTier
fn available_acceleration(&self) -> AccelerationTier
What the machine could run. Default equals this pass (
acceleration_tier).fn quin_seal( &mut self, subject: u64, predicate: u64, object: u64, context: u64, span: Span, ) -> Result<Value, Diagnostic>
fn hash_iri(&self, iri: &str) -> u64
fn graph_snapshot(&mut self, _span: Span) -> Result<Value, Diagnostic>
fn capability_resolve( &mut self, id: &str, _span: Span, ) -> Result<Value, Diagnostic>
Source§fn host_version(&self) -> &str
fn host_version(&self) -> &str
Host ABI version. Returns “vibe-host-0.1” for the current
trait surface. Hosts that add methods beyond 0.1 should
return “vibe-host-0.2” or higher.
fn environment(&self) -> HostEnvironment
fn acceleration_tier(&self) -> AccelerationTier
Source§fn time_proper_time(
&mut self,
_worldline_id: u64,
span: Span,
) -> Result<Value, Diagnostic>
fn time_proper_time( &mut self, _worldline_id: u64, span: Span, ) -> Result<Value, Diagnostic>
Proper time along a worldline, in seconds. Default: not available
(E702). Hosts with a manifold metric implementation override this.
Source§fn receipt_clock(&mut self, span: Span) -> Result<Value, Diagnostic>
fn receipt_clock(&mut self, span: Span) -> Result<Value, Diagnostic>
Deterministic replay clock for WASM. Returns None when no
replay clock is configured. When Some, the returned
{ secs, nanos } is used instead of wall-clock time.
Source§fn field_sample(
&mut self,
_field_ref: u64,
_pose: &Value,
span: Span,
) -> Result<Value, Diagnostic>
fn field_sample( &mut self, _field_ref: u64, _pose: &Value, span: Span, ) -> Result<Value, Diagnostic>
Sample a field at a pose. Returns a Quantity. Default: E702.
Source§fn law_apply(
&mut self,
_law_ref: u64,
_args: &[Value],
span: Span,
) -> Result<Value, Diagnostic>
fn law_apply( &mut self, _law_ref: u64, _args: &[Value], span: Span, ) -> Result<Value, Diagnostic>
Apply a law to arguments. Returns a Receipt. Default: E702.
Source§fn supports_isolation(&self) -> bool
fn supports_isolation(&self) -> bool
Whether this host supports isolation snapshots for dry-run
evaluation. Default: false. Hosts that can create an isolated
snapshot (e.g. PoetSnapshot::fork) override this to return true.
Source§fn conservation_check(
&mut self,
_quantity: &ConservationQuantity,
_before: &Value,
_after: &Value,
_tolerance: f64,
span: Span,
) -> Result<Value, Diagnostic>
fn conservation_check( &mut self, _quantity: &ConservationQuantity, _before: &Value, _after: &Value, _tolerance: f64, span: Span, ) -> Result<Value, Diagnostic>
Check whether a transformation preserves a conserved quantity (T34). Read more
Source§fn causal_relation(
&mut self,
_event_a: &Value,
_event_b: &Value,
span: Span,
) -> Result<Value, Diagnostic>
fn causal_relation( &mut self, _event_a: &Value, _event_b: &Value, span: Span, ) -> Result<Value, Diagnostic>
Determine the causal relation between two events (T35). Read more
Source§fn dag_execute(
&mut self,
_pipeline: &Value,
_blackboard: &Value,
span: Span,
) -> Result<Value, Diagnostic>
fn dag_execute( &mut self, _pipeline: &Value, _blackboard: &Value, span: Span, ) -> Result<Value, Diagnostic>
Execute a DAG pipeline (T24). The pipeline definition is passed
as a Record value (from JSON or VibeScript construction). The
host executes the DAG nodes in topological order, invoking
capabilities for each node. Default: E702 (no DAG executor
available on this host).
Source§fn dag_validate(
&mut self,
_pipeline: &Value,
span: Span,
) -> Result<Value, Diagnostic>
fn dag_validate( &mut self, _pipeline: &Value, span: Span, ) -> Result<Value, Diagnostic>
Validate a DAG pipeline definition (T24). Returns Ok(Null) if
valid, Err with diagnostic if invalid (cycle, missing budget,
missing capability). Default: E702.
Source§fn deontic_check(
&mut self,
_capability: &str,
_phase: &str,
span: Span,
) -> Result<Value, Diagnostic>
fn deontic_check( &mut self, _capability: &str, _phase: &str, span: Span, ) -> Result<Value, Diagnostic>
Check a deontic prohibition (T25). Given a capability ID and
the current phase, verify that the capability is allowed. If
forbidden, returns a sealed DeonticInterrupt receipt. Default:
E702 (no deontic checker available).
Source§fn hid_poll(&mut self, span: Span) -> Result<Value, Diagnostic>
fn hid_poll(&mut self, span: Span) -> Result<Value, Diagnostic>
Poll for the next inbound HID event (T42). Returns the next
event from the host’s HID loop, or Null if no event is
available (non-blocking). Default: E702 (no HID loop on this
host).
Source§fn hid_wait(
&mut self,
_timeout_ns: u64,
span: Span,
) -> Result<Value, Diagnostic>
fn hid_wait( &mut self, _timeout_ns: u64, span: Span, ) -> Result<Value, Diagnostic>
Wait for the next inbound HID event with a timeout (T42).
Returns the next event, or Null if the timeout expired.
Default: E702.
Source§fn cue_post(
&mut self,
_cue_id: &str,
_payload: &Value,
span: Span,
) -> Result<Value, Diagnostic>
fn cue_post( &mut self, _cue_id: &str, _payload: &Value, span: Span, ) -> Result<Value, Diagnostic>
Post an outbound cue (T45) — haptic, audio, visual, or
accessibility. The cue ID identifies the output channel and
the payload carries the cue data. Default: E702.
Source§fn crypto_hash(
&mut self,
_algorithm: &str,
_data: &str,
span: Span,
) -> Result<Value, Diagnostic>
fn crypto_hash( &mut self, _algorithm: &str, _data: &str, span: Span, ) -> Result<Value, Diagnostic>
Compute a cryptographic hash (T-crypto). The algorithm is one of
“SHA-256”, “SHA-512”, “BLAKE3”. The data is a String (UTF-8) or
hex-encoded String. Returns a Record
{ algorithm, hex, bytes }.
Default: E702 (no crypto provider on this host).Source§fn crypto_hkdf(
&mut self,
_ikm: &str,
_info: &str,
_length: u64,
span: Span,
) -> Result<Value, Diagnostic>
fn crypto_hkdf( &mut self, _ikm: &str, _info: &str, _length: u64, span: Span, ) -> Result<Value, Diagnostic>
Derive a key using HKDF-SHA256 (T-crypto). Returns the derived
key as a hex-encoded String. Default: E702.
Source§fn crypto_aead_encrypt(
&mut self,
_algorithm: &str,
_key_hex: &str,
_nonce_hex: &str,
_plaintext: &str,
_aad: &str,
span: Span,
) -> Result<Value, Diagnostic>
fn crypto_aead_encrypt( &mut self, _algorithm: &str, _key_hex: &str, _nonce_hex: &str, _plaintext: &str, _aad: &str, span: Span, ) -> Result<Value, Diagnostic>
AEAD encrypt (T-crypto). Returns a Record
{ algorithm, ciphertext_hex, tag_hex, nonce_hex }.
Default: E702.Source§fn crypto_aead_decrypt(
&mut self,
_algorithm: &str,
_key_hex: &str,
_nonce_hex: &str,
_ciphertext_hex: &str,
_tag_hex: &str,
_aad: &str,
span: Span,
) -> Result<Value, Diagnostic>
fn crypto_aead_decrypt( &mut self, _algorithm: &str, _key_hex: &str, _nonce_hex: &str, _ciphertext_hex: &str, _tag_hex: &str, _aad: &str, span: Span, ) -> Result<Value, Diagnostic>
AEAD decrypt (T-crypto). Returns the plaintext as a String, or
an error if decryption fails. Default: E702.
Source§fn crypto_sign(
&mut self,
_key_id: &str,
_data: &str,
span: Span,
) -> Result<Value, Diagnostic>
fn crypto_sign( &mut self, _key_id: &str, _data: &str, span: Span, ) -> Result<Value, Diagnostic>
Sign data with a key (T-crypto). The key_id identifies the key
in the host’s key vault. Returns a Record
{ key_id, signature_hex, algorithm }. Default: E702.Source§fn crypto_verify(
&mut self,
_key_id: &str,
_data: &str,
_signature_hex: &str,
span: Span,
) -> Result<Value, Diagnostic>
fn crypto_verify( &mut self, _key_id: &str, _data: &str, _signature_hex: &str, span: Span, ) -> Result<Value, Diagnostic>
Verify a signature (T-crypto). Returns Bool. Default: E702.
Source§fn crypto_generate_key(
&mut self,
_algorithm: &str,
span: Span,
) -> Result<Value, Diagnostic>
fn crypto_generate_key( &mut self, _algorithm: &str, span: Span, ) -> Result<Value, Diagnostic>
Generate a new key (T-crypto). The algorithm is one of “Ed25519”,
“ML-DSA-65”. Returns the key_id String. Default: E702.
Source§fn zk_prove_threshold(
&mut self,
_value: u64,
_threshold: u64,
span: Span,
) -> Result<Value, Diagnostic>
fn zk_prove_threshold( &mut self, _value: u64, _threshold: u64, span: Span, ) -> Result<Value, Diagnostic>
Prove, in zero knowledge, that a private
value satisfies
value >= threshold. Returns a Record
{ proof_hex, vk_hex, proof_id, circuit_id }.
Default: E702 (no ZK proof system on this host).Source§fn zk_verify_threshold(
&mut self,
_proof_hex: &str,
_vk_hex: &str,
_threshold: u64,
span: Span,
) -> Result<Value, Diagnostic>
fn zk_verify_threshold( &mut self, _proof_hex: &str, _vk_hex: &str, _threshold: u64, span: Span, ) -> Result<Value, Diagnostic>
Verify a ZK threshold proof against a public
threshold.
Returns Bool. Default: E702.Source§fn zk_prove_range(
&mut self,
_value: u64,
_lo: u64,
_hi: u64,
span: Span,
) -> Result<Value, Diagnostic>
fn zk_prove_range( &mut self, _value: u64, _lo: u64, _hi: u64, span: Span, ) -> Result<Value, Diagnostic>
Prove, in zero knowledge, that a private
value satisfies
lo <= value <= hi. Returns a Record
{ proof_hex, vk_hex, proof_id, circuit_id }.
Default: E702.Source§fn zk_verify_range(
&mut self,
_proof_hex: &str,
_vk_hex: &str,
_lo: u64,
_hi: u64,
span: Span,
) -> Result<Value, Diagnostic>
fn zk_verify_range( &mut self, _proof_hex: &str, _vk_hex: &str, _lo: u64, _hi: u64, span: Span, ) -> Result<Value, Diagnostic>
Verify a ZK range proof against public bounds
lo and hi.
Returns Bool. Default: E702.Source§fn zk_prove_matmul(
&mut self,
_m: u64,
_k: u64,
_n: u64,
_a: &[i128],
_b: &[i128],
span: Span,
) -> Result<Value, Diagnostic>
fn zk_prove_matmul( &mut self, _m: u64, _k: u64, _n: u64, _a: &[i128], _b: &[i128], span: Span, ) -> Result<Value, Diagnostic>
Prove a matrix multiplication: given public A, B, and claimed
C = A·B, prove the multiplication is correct without revealing
the witness. Returns a Record
{ valid, result }.
Default: E702.Source§fn zk_list_circuits(&mut self, span: Span) -> Result<Value, Diagnostic>
fn zk_list_circuits(&mut self, span: Span) -> Result<Value, Diagnostic>
List all registered ZK circuits. Returns a List of circuit IDs.
Default: E702.
Auto Trait Implementations§
impl Freeze for LocalHost
impl RefUnwindSafe for LocalHost
impl Send for LocalHost
impl Sync for LocalHost
impl Unpin for LocalHost
impl UnsafeUnpin for LocalHost
impl UnwindSafe for LocalHost
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