pub enum Capability {
Pure,
Ambient,
FsRead,
FsWrite,
Env,
HostInfo,
Net,
ClusterCredentials,
Secrets,
Subprocess,
ModuleLoad,
}Expand description
What a family of primitives can reach outside the process.
Ordered by blast radius, and deliberately coarse: a finer taxonomy invites arguments about which bucket a form belongs in, and the whole value here is that the answer is obvious.
Variants§
Pure
Computation only. No syscall reaches outside this process.
Ambient
Reads the clock or the random pool. Non-deterministic, but observes nothing it could not have been told.
FsRead
Reads the filesystem.
FsWrite
Writes or deletes on the filesystem.
Env
Reads or writes process environment variables.
HostInfo
Reads host identity — hostname, username, platform.
Net
Opens network connections, or listens.
ClusterCredentials
Reads Kubernetes service-account credentials.
Secrets
Decrypts secrets.
Subprocess
Starts a subprocess.
ModuleLoad
Loads and evaluates another module.
Implementations§
Source§impl Capability
impl Capability
Sourcepub fn escapes_process(self) -> bool
pub fn escapes_process(self) -> bool
Does this capability reach outside the process at all?
The gate in this crate’s tests keys on exactly this, so a new capability variant is classified once, here, rather than in every place that asks the question.
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 moreimpl Copy for Capability
Source§impl Debug for Capability
impl Debug for Capability
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
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
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.