pub struct Check {
pub permission: &'static PermissionInfo,
pub resource: ResourceRef,
pub origin: Origin,
}Expand description
One question for the Authorizer: does the caller hold permission on
resource? Operation::CHECKS produces one per declared clause that
applies to the request; handlers make their own.
Fields§
§permission: &'static PermissionInfo§resource: ResourceRef§origin: OriginImplementations§
Source§impl Check
impl Check
Sourcepub fn declared(
index: u16,
permission: &'static PermissionInfo,
resource: ResourceRef,
) -> Self
pub fn declared( index: u16, permission: &'static PermissionInfo, resource: ResourceRef, ) -> Self
The check of clause index of the operation’s requirements, whose
permission is permission, bound to resource from the input.
Sourcepub fn handler(
permission: impl Into<&'static PermissionInfo>,
resource: ResourceRef,
) -> Self
pub fn handler( permission: impl Into<&'static PermissionInfo>, resource: ResourceRef, ) -> Self
A check the handler makes that the model does not declare.
Sourcepub fn obligation(obligation: &Obligation, resource: ResourceRef) -> Self
pub fn obligation(obligation: &Obligation, resource: ResourceRef) -> Self
The check that discharges obligation against resource.
Trait Implementations§
impl Eq for Check
impl StructuralPartialEq for Check
Auto Trait Implementations§
impl Forget for Check
impl Freeze for Checkwhere
&'static PermissionInfo: Freeze,
&'static ResourceInfo: Freeze,
*const u8 is !null: Freeze,
PhantomData<Target>: Freeze,
impl Move for Check
impl RefUnwindSafe for Check
impl Send for Check
impl Sync for Checkwhere
RawVecInner: Sync,
impl Unpin for Check
impl UnsafeUnpin for Checkwhere
&'static PermissionInfo: UnsafeUnpin,
&'static ResourceInfo: UnsafeUnpin,
*const u8 is !null: UnsafeUnpin,
PhantomData<Target>: UnsafeUnpin,
impl UnwindSafe for Checkwhere
&'static PermissionInfo: UnwindSafe,
&'static ResourceInfo: UnwindSafe,
RawVecInner: 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