pub struct PolicyAwareEvaluator { /* private fields */ }Expand description
Policy-aware evaluator adapter for backward compatibility with CommandPolicyEvaluator
This adapter wraps UnifiedCommandEvaluator with policy rule evaluation, allowing gradual migration from CommandPolicyEvaluator to UnifiedCommandEvaluator.
Implementations§
Source§impl PolicyAwareEvaluator
impl PolicyAwareEvaluator
Sourcepub fn with_policy(
allow_policy_decision: bool,
policy_reason: impl Into<String>,
) -> Self
pub fn with_policy( allow_policy_decision: bool, policy_reason: impl Into<String>, ) -> Self
Create with explicit policy decision
Sourcepub async fn evaluate(&self, command: &[String]) -> Result<EvaluationResult>
pub async fn evaluate(&self, command: &[String]) -> Result<EvaluationResult>
Evaluate command with optional policy layer
Sourcepub fn set_policy(&mut self, allowed: bool, reason: impl Into<String>)
pub fn set_policy(&mut self, allowed: bool, reason: impl Into<String>)
Set policy decision (allows updating policy after creation)
Sourcepub fn clear_policy(&mut self)
pub fn clear_policy(&mut self)
Clear policy decision (revert to pure safety evaluation)
Sourcepub fn unified(&self) -> Arc<UnifiedCommandEvaluator> ⓘ
pub fn unified(&self) -> Arc<UnifiedCommandEvaluator> ⓘ
Get reference to the underlying evaluator for advanced access
Trait Implementations§
Source§impl Clone for PolicyAwareEvaluator
impl Clone for PolicyAwareEvaluator
Source§fn clone(&self) -> PolicyAwareEvaluator
fn clone(&self) -> PolicyAwareEvaluator
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl !RefUnwindSafe for PolicyAwareEvaluator
impl !UnwindSafe for PolicyAwareEvaluator
impl Freeze for PolicyAwareEvaluator
impl Send for PolicyAwareEvaluator
impl Sync for PolicyAwareEvaluator
impl Unpin for PolicyAwareEvaluator
impl UnsafeUnpin for PolicyAwareEvaluator
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