pub struct Grants {
pub filesystem: bool,
pub process: bool,
pub network: bool,
pub environment: bool,
pub session: bool,
}Expand description
What an extension may reach. The default grants everything, as pi does.
Fields§
§filesystem: boolRead and write files.
process: boolRun processes, which run as the user outside the sandbox.
network: boolSend HTTP requests and resolve host names.
environment: boolRead environment variables.
session: boolStart turns and change the session and its files.
Implementations§
Source§impl Grants
impl Grants
Sourcepub fn covers(&self, capability: &str) -> bool
pub fn covers(&self, capability: &str) -> bool
Whether these grants give all that capability, one of
CAPABILITIES, does. False for any other name.
Sourcepub fn names(&self) -> Vec<&'static str>
pub fn names(&self) -> Vec<&'static str>
The capabilities the grants amount to, as a manifest names them:
all alone when they give everything, else each other one of
CAPABILITIES they cover, then process when they let processes
run, which no manifest grants without all. Empty for none.
Sourcepub fn parse(values: &[String]) -> Result<Grants, String>
pub fn parse(values: &[String]) -> Result<Grants, String>
The grants of manifest capabilities values, each one of
CAPABILITIES or none. An empty list grants nothing, and only
all grants running processes. Err names an unknown value,
process, or none combined with another value.
Sourcepub fn intersection(self, other: Grants) -> Grants
pub fn intersection(self, other: Grants) -> Grants
What both self and other grant.
Trait Implementations§
impl Copy for Grants
Source§impl Display for Grants
The manifest capabilities the grants amount to, as Grants::names
lists them, or none: such as all, or fs, net.
impl Display for Grants
The manifest capabilities the grants amount to, as Grants::names
lists them, or none: such as all, or fs, net.
impl Eq for Grants
impl StructuralPartialEq for Grants
Auto Trait Implementations§
impl Forget for Grants
impl Freeze for Grants
impl RefUnwindSafe for Grants
impl Send for Grants
impl Sync for Grants
impl Unpin for Grants
impl UnsafeUnpin for Grants
impl UnwindSafe for Grants
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> 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.