pub struct ScopedEffects<'a> { /* private fields */ }Expand description
Borrow an existing native state owner and explicit host-held grants for one
dispatch scope. Construct only from native admission, never requires text.
This small cold authoring profile does not advertise graph, generic invokes,
private-key export or unrestricted host delegation. Other Host defaults are
unchanged and are not advertised by this profile. The native owner handles authentication,
current revocation and keeping this borrow within its admission transaction.
Implementations§
Source§impl<'a> ScopedEffects<'a>
impl<'a> ScopedEffects<'a>
pub fn new( snapshot: &'a mut PoetSnapshot, grants: &'a [&'a str], ) -> Result<Self, Diagnostic>
Trait Implementations§
Source§impl Host for ScopedEffects<'_>
impl Host for ScopedEffects<'_>
fn graph_query( &mut self, _: &[Value], _: u64, span: Span, ) -> Result<Value, Diagnostic>
fn graph_stage(&mut self, _: &Value, span: Span) -> Result<Value, Diagnostic>
fn graph_commit(&mut self, span: Span) -> Result<Value, Diagnostic>
fn aura_validate( &mut self, _: &Value, _: &Value, span: Span, ) -> Result<Value, Diagnostic>
fn pulse_publish( &mut self, topic: &str, payload: &Value, span: Span, ) -> Result<Value, Diagnostic>
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 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 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: &str,
span: Span,
) -> Result<Value, Diagnostic>
fn crypto_verify( &mut self, key_id: &str, data: &str, signature: &str, span: Span, ) -> Result<Value, Diagnostic>
Verify a signature (T-crypto). Returns Bool. Default: E702.
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 moreSource§fn time_unix(&mut self, span: Span) -> Result<Value, Diagnostic>
fn time_unix(&mut self, span: Span) -> Result<Value, Diagnostic>
Wall clock as seconds since Unix epoch. External (core §11): forbidden
in Pure cells. Default fails closed with E702 (WASM / hosts without a clock);
native hosts override with
SystemTime::now. Replay uses the receipt clock,
not this binding. Read moreSource§fn time_now(&mut self, span: Span) -> Result<Value, Diagnostic>
fn time_now(&mut self, span: Span) -> Result<Value, Diagnostic>
The primary time primitive (X6): returns
Value::Instant with
nanosecond resolution, explicit TimeScale, and optional seal.
Default fails closed with E702. Native hosts override with
SystemTime::now → Instant::unix(secs, nanos).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).
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 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 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 available_acceleration(&self) -> AccelerationTier
fn available_acceleration(&self) -> AccelerationTier
What the machine could run. Default equals this pass (
acceleration_tier).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_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 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<'a> !UnwindSafe for ScopedEffects<'a>
impl<'a> Freeze for ScopedEffects<'a>
impl<'a> RefUnwindSafe for ScopedEffects<'a>
impl<'a> Send for ScopedEffects<'a>
impl<'a> Sync for ScopedEffects<'a>
impl<'a> Unpin for ScopedEffects<'a>
impl<'a> UnsafeUnpin for ScopedEffects<'a>
Blanket Implementations§
§impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
impl<S, A> Aggregate<Result<S, Error>> for Awhere
A: Aggregate<S>,
Aggregate shares in an MPC protocol.
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more