pub enum Capability {
FsRead {
root: PathRoot,
},
FsWrite {
root: PathRoot,
},
Network {
host: NetworkHost,
},
CrossComponentRead {
target: ComponentId,
},
}Expand description
One kind paired with its only valid scope type.
Variants§
FsRead
Filesystem read authority rooted at root.
FsWrite
Filesystem write authority rooted at root.
Network
Network authority for exactly host.
Fields
host: NetworkHostExact host; no glob or pattern syntax is recognized.
CrossComponentRead
Read authority for exactly one foreign component.
Fields
target: ComponentIdComponent whose ephemeral read-only view may be resolved.
Implementations§
Source§impl Capability
impl Capability
Sourcepub const fn kind(&self) -> CapabilityKind
pub const fn kind(&self) -> CapabilityKind
Returns the closed kind represented by this scoped capability.
Sourcepub fn scope(&self) -> CapabilityScope
pub fn scope(&self) -> CapabilityScope
Returns a typed copy of this capability’s scope.
Sourcepub fn validate(&self) -> Result<(), ScopeValidationError>
pub fn validate(&self) -> Result<(), ScopeValidationError>
Validates that this scope can be safely matched by the v1 exact rules.
§Errors
Returns why a path root or exact host is malformed.
Sourcepub fn covers(&self, consumed: &Capability) -> bool
pub fn covers(&self, consumed: &Capability) -> bool
Reports whether this declaration/grant covers one consuming act.
Filesystem roots use lexical path containment. Network and component scopes use exact equality; there is no glob or pattern interpretation.
Trait Implementations§
Source§impl Clone for Capability
impl Clone for Capability
Source§fn clone(&self) -> Capability
fn clone(&self) -> Capability
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Capability
impl Debug for Capability
Source§impl<'de> Deserialize<'de> for Capability
impl<'de> Deserialize<'de> for Capability
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Capability, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Capability, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
impl Eq for Capability
Source§impl Hash for Capability
impl Hash for Capability
Source§impl Ord for Capability
impl Ord for Capability
Source§fn cmp(&self, other: &Capability) -> Ordering
fn cmp(&self, other: &Capability) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for Capability
impl PartialEq for Capability
Source§impl PartialOrd for Capability
impl PartialOrd for Capability
Source§impl Serialize for Capability
impl Serialize for Capability
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl StructuralPartialEq for Capability
Auto Trait Implementations§
impl Freeze for Capability
impl RefUnwindSafe for Capability
impl Send for Capability
impl Sync for Capability
impl Unpin for Capability
impl UnsafeUnpin for Capability
impl UnwindSafe for Capability
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.