#[context]Expand description
Transforms a struct with permission-type fields into a capability context.
Generates:
- Field types rewritten from
PermTypetoCap<PermType>(orSendCap<PermType>) - A
new(root: &CapRoot) -> Selfconstructor impl Has<P>for each field’s permission type
§Usage
ⓘ
#[capsec::context]
struct AppCtx {
fs: FsRead,
net: NetConnect,
}
// Send variant for async/threaded code:
#[capsec::context(send)]
struct AsyncCtx {
fs: FsRead,
net: NetConnect,
}