#[non_exhaustive]pub enum CapToken {
StateRead,
StateWrite,
EmitExtraBytes,
FuelConsumed,
}Expand description
Capability tokens an enabled hook may request from the host. Each token grants permission to call a single host-side function — non- whitelisted imports are rejected at module-load (E14.L2-Allow enforcement).
#[non_exhaustive] — additive expansion is non-breaking (TypeCode
forward-compat). Ord/PartialOrd are required so CapToken can
live in a deterministic std::collections::BTreeSet (the
HookStoreData::capabilities container — deterministic iteration
matters for the call-time capability check audit log).
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
StateRead
arkhe:hook/state.read — read the hook-scoped key/value scratchpad.
StateWrite
arkhe:hook/state.write — write the hook-scoped scratchpad.
EmitExtraBytes
arkhe:hook/emit.extra_bytes — append into ExtraBytesBuilder.
FuelConsumed
arkhe:hook/fuel.consumed — query remaining fuel budget.
Trait Implementations§
Source§impl Ord for CapToken
impl Ord for CapToken
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for CapToken
impl PartialOrd for CapToken
impl Copy for CapToken
impl Eq for CapToken
impl StructuralPartialEq for CapToken
Auto Trait Implementations§
impl Freeze for CapToken
impl RefUnwindSafe for CapToken
impl Send for CapToken
impl Sync for CapToken
impl Unpin for CapToken
impl UnsafeUnpin for CapToken
impl UnwindSafe for CapToken
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.