pub struct CodingPolicyEngine<P = DefaultPolicyEngine> { /* private fields */ }Expand description
Conservative coding policy wrapper around a host policy engine.
Implementations§
Source§impl CodingPolicyEngine<DefaultPolicyEngine>
impl CodingPolicyEngine<DefaultPolicyEngine>
Sourcepub fn conservative() -> Self
pub fn conservative() -> Self
Constructs the conservative preset with the default fallback policy.
Source§impl<P> CodingPolicyEngine<P>
impl<P> CodingPolicyEngine<P>
Sourcepub fn new(inner: P) -> Self
pub fn new(inner: P) -> Self
Constructs a coding policy wrapper around a fallback policy engine.
Sourcepub fn with_taxonomy(self, taxonomy: CommandTaxonomy) -> Self
pub fn with_taxonomy(self, taxonomy: CommandTaxonomy) -> Self
Replaces the command taxonomy and host allowlists.
Sourcepub fn taxonomy(&self) -> &CommandTaxonomy
pub fn taxonomy(&self) -> &CommandTaxonomy
Returns the configured taxonomy.
Trait Implementations§
Source§impl<P: Clone> Clone for CodingPolicyEngine<P>
impl<P: Clone> Clone for CodingPolicyEngine<P>
Source§impl<P: Debug> Debug for CodingPolicyEngine<P>
impl<P: Debug> Debug for CodingPolicyEngine<P>
Source§impl<P> PolicyEngine for CodingPolicyEngine<P>where
P: PolicyEngine,
impl<P> PolicyEngine for CodingPolicyEngine<P>where
P: PolicyEngine,
Source§fn evaluate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
effect: &'life1 ClassifiedEffect,
context: &'life2 RunContext,
) -> Pin<Box<dyn Future<Output = Result<PolicyDecision, HarnessError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn evaluate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
effect: &'life1 ClassifiedEffect,
context: &'life2 RunContext,
) -> Pin<Box<dyn Future<Output = Result<PolicyDecision, HarnessError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Evaluates policy.
Auto Trait Implementations§
impl<P> Freeze for CodingPolicyEngine<P>where
P: Freeze,
impl<P> RefUnwindSafe for CodingPolicyEngine<P>where
P: RefUnwindSafe,
impl<P> Send for CodingPolicyEngine<P>where
P: Send,
impl<P> Sync for CodingPolicyEngine<P>where
P: Sync,
impl<P> Unpin for CodingPolicyEngine<P>where
P: Unpin,
impl<P> UnsafeUnpin for CodingPolicyEngine<P>where
P: UnsafeUnpin,
impl<P> UnwindSafe for CodingPolicyEngine<P>where
P: UnwindSafe,
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