pub struct PluginPermissions {
pub network: Vec<String>,
pub filesystem: Vec<String>,
pub env_vars: Vec<String>,
pub shell: bool,
}Expand description
Permissions requested by a plugin.
Fields§
§network: Vec<String>Allowed network hosts. Empty = no network. ["*"] = all hosts.
filesystem: Vec<String>Allowed filesystem paths.
env_vars: Vec<String>Allowed environment variable names.
shell: boolWhether the plugin can execute shell commands.
Implementations§
Source§impl PluginPermissions
impl PluginPermissions
Sourcepub fn diff(
approved: &PluginPermissions,
requested: &PluginPermissions,
) -> PermissionDiff
pub fn diff( approved: &PluginPermissions, requested: &PluginPermissions, ) -> PermissionDiff
Compute the diff between previously approved permissions and newly requested permissions.
Returns a PermissionDiff containing only the items in requested
that are not present in approved. For the shell field, only an
escalation from false to true counts as a new permission.
Trait Implementations§
Source§impl Clone for PluginPermissions
impl Clone for PluginPermissions
Source§fn clone(&self) -> PluginPermissions
fn clone(&self) -> PluginPermissions
Returns a duplicate of the value. Read more
1.0.0 · 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 PluginPermissions
impl Debug for PluginPermissions
Source§impl Default for PluginPermissions
impl Default for PluginPermissions
Source§fn default() -> PluginPermissions
fn default() -> PluginPermissions
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PluginPermissions
impl<'de> Deserialize<'de> for PluginPermissions
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PluginPermissions
impl PartialEq for PluginPermissions
Source§impl Serialize for PluginPermissions
impl Serialize for PluginPermissions
impl StructuralPartialEq for PluginPermissions
Auto Trait Implementations§
impl Freeze for PluginPermissions
impl RefUnwindSafe for PluginPermissions
impl Send for PluginPermissions
impl Sync for PluginPermissions
impl Unpin for PluginPermissions
impl UnsafeUnpin for PluginPermissions
impl UnwindSafe for PluginPermissions
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