pub struct AgentGuard { /* private fields */ }Implementations§
Source§impl AgentGuard
impl AgentGuard
pub fn from_contract(contract: &Value) -> Self
Sourcepub fn set_negative_capabilities(&mut self, caps: Vec<NegativeCapability>)
pub fn set_negative_capabilities(&mut self, caps: Vec<NegativeCapability>)
Replace the negative capability list (e.g. on policy reload).
Sourcepub fn set_enforcement_level(&mut self, level: EnforcementLevel)
pub fn set_enforcement_level(&mut self, level: EnforcementLevel)
Replace the enforcement level (e.g. when shadow-mode toggles).
pub fn enforcement_level(&self) -> EnforcementLevel
pub fn set_event_listener<F>(&mut self, f: F)
Sourcepub fn actions(&self) -> impl Iterator<Item = &IndexedAction>
pub fn actions(&self) -> impl Iterator<Item = &IndexedAction>
Every action declared in the bound contract, keyed by action name. Callers use this to present contract contents in UIs or to enumerate which actions exist before invoking the guard.
pub fn action_by_name(&self, name: &str) -> Option<&IndexedAction>
pub fn forbidden_actions(&self) -> impl Iterator<Item = (&String, &String)>
pub fn target_sets(&self) -> impl Iterator<Item = (&String, &Vec<String>)>
pub fn check(&self, query: &GuardQuery) -> GuardDecision
Sourcepub fn check_raw(&self, query: &GuardQuery) -> GuardDecision
pub fn check_raw(&self, query: &GuardQuery) -> GuardDecision
Run the rule logic without applying the EnforcementLevel filter.
Auto Trait Implementations§
impl !RefUnwindSafe for AgentGuard
impl !UnwindSafe for AgentGuard
impl Freeze for AgentGuard
impl Send for AgentGuard
impl Sync for AgentGuard
impl Unpin for AgentGuard
impl UnsafeUnpin for AgentGuard
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more