pub struct FnPolicy { /* private fields */ }Expand description
A ServerPolicy made of closures, one per decision. A decision with no
closure keeps the trait’s default; with no mutation closure it doesn’t
decide mutations at all (ServerPolicy::decides_mutations).
Each closure follows the calling rules of the method it stands for.
Implementations§
Source§impl FnPolicy
impl FnPolicy
Sourcepub fn mutation(
self,
decide: impl Fn(&MutationAuthorizationContext) -> bool + Send + Sync + 'static,
) -> Self
pub fn mutation( self, decide: impl Fn(&MutationAuthorizationContext) -> bool + Send + Sync + 'static, ) -> Self
Decide mutations with decide; see ServerPolicy::authorize_mutation.
Sourcepub fn life_safety_operation(
self,
decide: impl Fn(&LifeSafetyOperationAuthorizationContext) -> bool + Send + Sync + 'static,
) -> Self
pub fn life_safety_operation( self, decide: impl Fn(&LifeSafetyOperationAuthorizationContext) -> bool + Send + Sync + 'static, ) -> Self
Decide LifeSafetyOperation with decide; see
ServerPolicy::authorize_life_safety_operation.
Sourcepub fn audit_notification(
self,
decide: impl Fn(&AuditNotificationAuthorizationContext) -> bool + Send + Sync + 'static,
) -> Self
pub fn audit_notification( self, decide: impl Fn(&AuditNotificationAuthorizationContext) -> bool + Send + Sync + 'static, ) -> Self
Decide ConfirmedAuditNotification with decide; see
ServerPolicy::authorize_audit_notification.
Sourcepub fn unconfirmed_audit_notification(
self,
decide: impl Fn(&UnconfirmedAuditNotificationAuthorizationContext) -> bool + Send + Sync + 'static,
) -> Self
pub fn unconfirmed_audit_notification( self, decide: impl Fn(&UnconfirmedAuditNotificationAuthorizationContext) -> bool + Send + Sync + 'static, ) -> Self
Decide UnconfirmedAuditNotification with decide; see
ServerPolicy::authorize_unconfirmed_audit_notification.
Trait Implementations§
Source§impl ServerPolicy for FnPolicy
impl ServerPolicy for FnPolicy
Source§fn decides_mutations(&self) -> bool
fn decides_mutations(&self) -> bool
Only when it was given a mutation closure.
Whether to carry out one covered mutation (default: allow). Read more
Whether to carry out a LifeSafetyOperation (default: deny). Read more
Whether to store a ConfirmedAuditNotification in the configured
Audit Log sink (default: deny). Read more
Whether to store an UnconfirmedAuditNotification in the configured
Audit Log sink (default: deny). Read more
Auto Trait Implementations§
impl !RefUnwindSafe for FnPolicy
impl !UnwindSafe for FnPolicy
impl Freeze for FnPolicy
impl Send for FnPolicy
impl Sync for FnPolicy
impl Unpin for FnPolicy
impl UnsafeUnpin for FnPolicy
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