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 device_communication_control(
self,
decide: impl Fn(&DeviceCommunicationControlAuthorizationContext) -> bool + Send + Sync + 'static,
) -> Self
pub fn device_communication_control( self, decide: impl Fn(&DeviceCommunicationControlAuthorizationContext) -> bool + Send + Sync + 'static, ) -> Self
Decide DeviceCommunicationControl with decide; see
ServerPolicy::authorize_device_communication_control.
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.