pub struct Cap(/* private fields */);Expand description
A capability this service holds, by the slot the kernel put it in.
Thin on purpose: the value is an index into this task’s capability table, and the kernel is what gives it meaning. Wrapping it in a type stops it being confused with the resource ids, endpoint ids and file descriptors it is NOT.
Implementations§
Trait Implementations§
Source§impl From<CapHandle> for Cap
Adopt a handle an SDK call outside this library returned - a spawn that hands back an endpoint, a
minted resource, a capability looked up by contract name - so the rest of its life is spent here.
impl From<CapHandle> for Cap
Adopt a handle an SDK call outside this library returned - a spawn that hands back an endpoint, a minted resource, a capability looked up by contract name - so the rest of its life is spent here.
This grants nothing and forges nothing. A handle is a slot number anyone can type; what makes a
capability unforgeable is the kernel, which checks the slot, its generation and its rights on every
use (CLAUDE.md 7.3). Wrapping a number that is not a capability yields a Cap every call refuses.