pub struct ScopeCard { /* private fields */ }Expand description
An invocation-local card derived with derive_scope.
A scope card is valid only during the invocation that derived it. Lend it
to the callee of an awaited agent call with a generated client’s
with_scope_card or set_default_scope_card, or with the
*_with_scope_card methods of the dynamic clients; the callee holds its
authority until that call ends. Lending borrows the card and never
consumes it. When the invocation ends, the host retires the scope card:
the handle stays valid until it is dropped, but lending it to an awaited
call, directly or as a client’s default, fails with a denied RPC error,
and using it as a derive_scope parent fails with
PermissionError::NotPermitted.
A scope card cannot be revoked, installed, derived into a persistent card, serialized, or passed as an agent method argument or result. Dropping it releases the handle.
Implementations§
Source§impl ScopeCard
impl ScopeCard
Sourcepub fn parents(&self) -> Vec<CardId>
pub fn parents(&self) -> Vec<CardId>
The identifiers of the persistent root cards of this scope card.
Sourcepub fn expires_at(&self) -> Option<Timestamp>
pub fn expires_at(&self) -> Option<Timestamp>
The earliest expiry of the root cards of this scope card, or None
when no root card expires. The scope card stops authorizing then.
Sourcepub fn inspect(&self) -> Result<CardView, PermissionError>
pub fn inspect(&self) -> Result<CardView, PermissionError>
Returns the four grant lists of this scope card. Requires card:inspect.