pub struct ConstraintContext {
pub purpose: Option<String>,
pub now: Option<DateTime<Utc>>,
pub custom: HashMap<String, String>,
}Expand description
Context provided when evaluating constraints.
The context carries all information about the current request that constraints might need to evaluate. Add fields here as your policies grow.
Fields§
§purpose: Option<String>The purpose of this access request (e.g., "analytics", "audit").
now: Option<DateTime<Utc>>The current time (defaults to Utc::now() if not specified).
custom: HashMap<String, String>An arbitrary key-value store for custom constraint operands.
Implementations§
Trait Implementations§
Source§impl Clone for ConstraintContext
impl Clone for ConstraintContext
Source§fn clone(&self) -> ConstraintContext
fn clone(&self) -> ConstraintContext
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 moreSource§impl Debug for ConstraintContext
impl Debug for ConstraintContext
Source§impl Default for ConstraintContext
impl Default for ConstraintContext
Source§fn default() -> ConstraintContext
fn default() -> ConstraintContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ConstraintContext
impl RefUnwindSafe for ConstraintContext
impl Send for ConstraintContext
impl Sync for ConstraintContext
impl Unpin for ConstraintContext
impl UnsafeUnpin for ConstraintContext
impl UnwindSafe for ConstraintContext
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