pub struct ReadPolicy {
pub trust: TrustLevel,
pub capabilities: CapabilitySet,
}Expand description
The trust level and capability set governing a read.
Pairs a TrustLevel with a CapabilitySet so the kernel can both
check possession and apply trust-sensitive policy.
Fields§
§trust: TrustLevelThe trust level of the source being read.
capabilities: CapabilitySetThe capabilities granted to the read.
Implementations§
Source§impl ReadPolicy
impl ReadPolicy
Sourcepub fn require(&self, capability: &CapabilityName) -> Result<()>
pub fn require(&self, capability: &CapabilityName) -> Result<()>
Demands a capability, applying trust policy on top of possession.
Returns Error::CapabilityDenied when the capability is not granted,
and Error::TrustDenied when an Untrusted
source requests the read-eval capability.
Trait Implementations§
Source§impl Clone for ReadPolicy
impl Clone for ReadPolicy
Source§fn clone(&self) -> ReadPolicy
fn clone(&self) -> ReadPolicy
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 ReadPolicy
impl Debug for ReadPolicy
Source§impl Default for ReadPolicy
impl Default for ReadPolicy
Source§fn default() -> ReadPolicy
fn default() -> ReadPolicy
Returns the “default value” for a type. Read more
impl Eq for ReadPolicy
Source§impl PartialEq for ReadPolicy
impl PartialEq for ReadPolicy
Source§fn eq(&self, other: &ReadPolicy) -> bool
fn eq(&self, other: &ReadPolicy) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ReadPolicy
Auto Trait Implementations§
impl Freeze for ReadPolicy
impl RefUnwindSafe for ReadPolicy
impl Send for ReadPolicy
impl Sync for ReadPolicy
impl Unpin for ReadPolicy
impl UnsafeUnpin for ReadPolicy
impl UnwindSafe for ReadPolicy
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