pub struct ContextGrant {
pub scopes: Vec<StateScope>,
pub channels: Vec<String>,
}Expand description
A narrow slice of context handed to a member alongside its input (R0.7 wave 3). Grants only ever narrow what the target agent already declared in its manifest — a delegation must never become a privilege escalation path. The server rejects a widening grant at submission.
Fields§
§scopes: Vec<StateScope>The state scopes the member may touch for this delegation; each must be a subset of the target manifest’s declared scopes.
channels: Vec<String>Named context channels (team thread ids, KV prefixes) the member may read. Free-form strings: channels are addressing, not taxonomy.
Implementations§
Source§impl ContextGrant
impl ContextGrant
Sourcepub fn narrows(&self, declared: &[StateScope]) -> bool
pub fn narrows(&self, declared: &[StateScope]) -> bool
true when every granted scope is declared by the target manifest —
the only direction a grant may point. Checked at submission; a
widening grant is a 400, not a runtime surprise.
Trait Implementations§
Source§impl Clone for ContextGrant
impl Clone for ContextGrant
Source§impl Debug for ContextGrant
impl Debug for ContextGrant
Source§impl Default for ContextGrant
impl Default for ContextGrant
Source§impl<'de> Deserialize<'de> for ContextGrant
impl<'de> Deserialize<'de> for ContextGrant
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ContextGrant
impl PartialEq for ContextGrant
Source§impl Serialize for ContextGrant
impl Serialize for ContextGrant
impl StructuralPartialEq for ContextGrant
Auto Trait Implementations§
impl Freeze for ContextGrant
impl RefUnwindSafe for ContextGrant
impl Send for ContextGrant
impl Sync for ContextGrant
impl Unpin for ContextGrant
impl UnsafeUnpin for ContextGrant
impl UnwindSafe for ContextGrant
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