pub struct PolicyEngine { /* private fields */ }Expand description
Policy Engine for enforcing rules on SType operations
Implementations§
Source§impl PolicyEngine
impl PolicyEngine
Sourcepub fn add_policy(&mut self, policy: Policy)
pub fn add_policy(&mut self, policy: Policy)
Add a policy
Sourcepub fn set_default_profile(&mut self, profile: impl Into<String>)
pub fn set_default_profile(&mut self, profile: impl Into<String>)
Set default QoM profile
Sourcepub fn evaluate(&self, context: &PolicyContext) -> PolicyDecision
pub fn evaluate(&self, context: &PolicyContext) -> PolicyDecision
Evaluate policies for an SType operation
Sourcepub fn required_profile(&self, stype: &SType) -> Option<&str>
pub fn required_profile(&self, stype: &SType) -> Option<&str>
Get required QoM profile for an SType
Sourcepub fn from_config(config: PolicyConfig) -> Self
pub fn from_config(config: PolicyConfig) -> Self
Load policies from configuration
Trait Implementations§
Source§impl Clone for PolicyEngine
impl Clone for PolicyEngine
Source§fn clone(&self) -> PolicyEngine
fn clone(&self) -> PolicyEngine
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PolicyEngine
impl Debug for PolicyEngine
Source§impl Default for PolicyEngine
impl Default for PolicyEngine
Source§fn default() -> PolicyEngine
fn default() -> PolicyEngine
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PolicyEngine
impl RefUnwindSafe for PolicyEngine
impl Send for PolicyEngine
impl Sync for PolicyEngine
impl Unpin for PolicyEngine
impl UnwindSafe for PolicyEngine
Blanket Implementations§
Source§impl<T> AnyExt for T
impl<T> AnyExt for T
Source§fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
fn downcast_ref<T>(this: &Self) -> Option<&T>where
T: Any,
Attempts to downcast this to
T behind referenceSource§fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
fn downcast_mut<T>(this: &mut Self) -> Option<&mut T>where
T: Any,
Attempts to downcast this to
T behind mutable referenceSource§fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
fn downcast_rc<T>(this: Rc<Self>) -> Result<Rc<T>, Rc<Self>>where
T: Any,
Attempts to downcast this to
T behind Rc pointerSource§fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
fn downcast_arc<T>(this: Arc<Self>) -> Result<Arc<T>, Arc<Self>>where
T: Any,
Attempts to downcast this to
T behind Arc pointerSource§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