Struct deno_runtime::permissions::Permissions
source · pub struct Permissions {
pub read: UnaryPermission<ReadDescriptor>,
pub write: UnaryPermission<WriteDescriptor>,
pub net: UnaryPermission<NetDescriptor>,
pub env: UnaryPermission<EnvDescriptor>,
pub sys: UnaryPermission<SysDescriptor>,
pub run: UnaryPermission<RunDescriptor>,
pub ffi: UnaryPermission<FfiDescriptor>,
pub hrtime: UnitPermission,
}
Fields§
§read: UnaryPermission<ReadDescriptor>
§write: UnaryPermission<WriteDescriptor>
§net: UnaryPermission<NetDescriptor>
§env: UnaryPermission<EnvDescriptor>
§sys: UnaryPermission<SysDescriptor>
§run: UnaryPermission<RunDescriptor>
§ffi: UnaryPermission<FfiDescriptor>
§hrtime: UnitPermission
Implementations§
source§impl Permissions
impl Permissions
pub fn new_read( allow_list: &Option<Vec<PathBuf>>, deny_list: &Option<Vec<PathBuf>>, prompt: bool ) -> Result<UnaryPermission<ReadDescriptor>, AnyError>
pub fn new_write( allow_list: &Option<Vec<PathBuf>>, deny_list: &Option<Vec<PathBuf>>, prompt: bool ) -> Result<UnaryPermission<WriteDescriptor>, AnyError>
pub fn new_net( allow_list: &Option<Vec<String>>, deny_list: &Option<Vec<String>>, prompt: bool ) -> Result<UnaryPermission<NetDescriptor>, AnyError>
pub fn new_env( allow_list: &Option<Vec<String>>, deny_list: &Option<Vec<String>>, prompt: bool ) -> Result<UnaryPermission<EnvDescriptor>, AnyError>
pub fn new_sys( allow_list: &Option<Vec<String>>, deny_list: &Option<Vec<String>>, prompt: bool ) -> Result<UnaryPermission<SysDescriptor>, AnyError>
pub fn new_run( allow_list: &Option<Vec<String>>, deny_list: &Option<Vec<String>>, prompt: bool ) -> Result<UnaryPermission<RunDescriptor>, AnyError>
pub fn new_ffi( allow_list: &Option<Vec<PathBuf>>, deny_list: &Option<Vec<PathBuf>>, prompt: bool ) -> Result<UnaryPermission<FfiDescriptor>, AnyError>
pub fn new_hrtime(allow_state: bool, deny_state: bool) -> UnitPermission
pub fn from_options(opts: &PermissionsOptions) -> Result<Self, AnyError>
pub fn allow_all() -> Self
sourcepub fn check_specifier(
&mut self,
specifier: &ModuleSpecifier
) -> Result<(), AnyError>
pub fn check_specifier( &mut self, specifier: &ModuleSpecifier ) -> Result<(), AnyError>
A helper function that determines if the module specifier is a local or remote, and performs a read or net check for the specifier.
Trait Implementations§
source§impl Clone for Permissions
impl Clone for Permissions
source§fn clone(&self) -> Permissions
fn clone(&self) -> Permissions
Returns a copy 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 Permissions
impl Debug for Permissions
source§impl Default for Permissions
impl Default for Permissions
source§impl PartialEq<Permissions> for Permissions
impl PartialEq<Permissions> for Permissions
source§fn eq(&self, other: &Permissions) -> bool
fn eq(&self, other: &Permissions) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl Eq for Permissions
impl StructuralEq for Permissions
impl StructuralPartialEq for Permissions
Auto Trait Implementations§
impl RefUnwindSafe for Permissions
impl Send for Permissions
impl Sync for Permissions
impl Unpin for Permissions
impl UnwindSafe for Permissions
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
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
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.