Struct deno_runtime::permissions::UnaryPermission
source · pub struct UnaryPermission<T: Descriptor + Hash> {
pub granted_global: bool,
pub granted_list: HashSet<T>,
pub flag_denied_global: bool,
pub flag_denied_list: HashSet<T>,
pub prompt_denied_global: bool,
pub prompt_denied_list: HashSet<T>,
pub prompt: bool,
}
Fields§
§granted_global: bool
§granted_list: HashSet<T>
§flag_denied_global: bool
§flag_denied_list: HashSet<T>
§prompt_denied_global: bool
§prompt_denied_list: HashSet<T>
§prompt: bool
Implementations§
source§impl UnaryPermission<ReadDescriptor>
impl UnaryPermission<ReadDescriptor>
pub fn query(&self, path: Option<&Path>) -> PermissionState
pub fn request(&mut self, path: Option<&Path>) -> PermissionState
pub fn revoke(&mut self, path: Option<&Path>) -> PermissionState
pub fn check( &mut self, path: &Path, api_name: Option<&str> ) -> Result<(), AnyError>
pub fn check_partial( &mut self, path: &Path, api_name: Option<&str> ) -> Result<(), AnyError>
sourcepub fn check_blind(
&mut self,
path: &Path,
display: &str,
api_name: &str
) -> Result<(), AnyError>
pub fn check_blind( &mut self, path: &Path, display: &str, api_name: &str ) -> Result<(), AnyError>
As check()
, but permission error messages will anonymize the path
by replacing it with the given display
.
pub fn check_all(&mut self, api_name: Option<&str>) -> Result<(), AnyError>
source§impl UnaryPermission<WriteDescriptor>
impl UnaryPermission<WriteDescriptor>
pub fn query(&self, path: Option<&Path>) -> PermissionState
pub fn request(&mut self, path: Option<&Path>) -> PermissionState
pub fn revoke(&mut self, path: Option<&Path>) -> PermissionState
pub fn check( &mut self, path: &Path, api_name: Option<&str> ) -> Result<(), AnyError>
pub fn check_partial( &mut self, path: &Path, api_name: Option<&str> ) -> Result<(), AnyError>
sourcepub fn check_blind(
&mut self,
path: &Path,
display: &str,
api_name: &str
) -> Result<(), AnyError>
pub fn check_blind( &mut self, path: &Path, display: &str, api_name: &str ) -> Result<(), AnyError>
As check()
, but permission error messages will anonymize the path
by replacing it with the given display
.
pub fn check_all(&mut self, api_name: Option<&str>) -> Result<(), AnyError>
source§impl UnaryPermission<NetDescriptor>
impl UnaryPermission<NetDescriptor>
pub fn query<T: AsRef<str>>( &self, host: Option<&(T, Option<u16>)> ) -> PermissionState
pub fn request<T: AsRef<str>>( &mut self, host: Option<&(T, Option<u16>)> ) -> PermissionState
pub fn revoke<T: AsRef<str>>( &mut self, host: Option<&(T, Option<u16>)> ) -> PermissionState
pub fn check<T: AsRef<str>>( &mut self, host: &(T, Option<u16>), api_name: Option<&str> ) -> Result<(), AnyError>
pub fn check_url( &mut self, url: &Url, api_name: Option<&str> ) -> Result<(), AnyError>
pub fn check_all(&mut self) -> Result<(), AnyError>
source§impl UnaryPermission<EnvDescriptor>
impl UnaryPermission<EnvDescriptor>
pub fn query(&self, env: Option<&str>) -> PermissionState
pub fn request(&mut self, env: Option<&str>) -> PermissionState
pub fn revoke(&mut self, env: Option<&str>) -> PermissionState
pub fn check(&mut self, env: &str) -> Result<(), AnyError>
pub fn check_all(&mut self) -> Result<(), AnyError>
source§impl UnaryPermission<SysDescriptor>
impl UnaryPermission<SysDescriptor>
pub fn query(&self, kind: Option<&str>) -> PermissionState
pub fn request(&mut self, kind: Option<&str>) -> PermissionState
pub fn revoke(&mut self, kind: Option<&str>) -> PermissionState
pub fn check( &mut self, kind: &str, api_name: Option<&str> ) -> Result<(), AnyError>
pub fn check_all(&mut self) -> Result<(), AnyError>
source§impl UnaryPermission<RunDescriptor>
impl UnaryPermission<RunDescriptor>
pub fn query(&self, cmd: Option<&str>) -> PermissionState
pub fn request(&mut self, cmd: Option<&str>) -> PermissionState
pub fn revoke(&mut self, cmd: Option<&str>) -> PermissionState
pub fn check( &mut self, cmd: &str, api_name: Option<&str> ) -> Result<(), AnyError>
pub fn check_all(&mut self, api_name: Option<&str>) -> Result<(), AnyError>
source§impl UnaryPermission<FfiDescriptor>
impl UnaryPermission<FfiDescriptor>
pub fn query(&self, path: Option<&Path>) -> PermissionState
pub fn request(&mut self, path: Option<&Path>) -> PermissionState
pub fn revoke(&mut self, path: Option<&Path>) -> PermissionState
pub fn check( &mut self, path: &Path, api_name: Option<&str> ) -> Result<(), AnyError>
pub fn check_partial(&mut self, path: Option<&Path>) -> Result<(), AnyError>
pub fn check_all(&mut self) -> Result<(), AnyError>
Trait Implementations§
source§impl<T: Clone + Descriptor + Hash> Clone for UnaryPermission<T>
impl<T: Clone + Descriptor + Hash> Clone for UnaryPermission<T>
source§fn clone(&self) -> UnaryPermission<T>
fn clone(&self) -> UnaryPermission<T>
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<T: Debug + Descriptor + Hash> Debug for UnaryPermission<T>
impl<T: Debug + Descriptor + Hash> Debug for UnaryPermission<T>
source§impl<T: Descriptor + Hash> Default for UnaryPermission<T>
impl<T: Descriptor + Hash> Default for UnaryPermission<T>
source§impl<T: PartialEq + Descriptor + Hash> PartialEq<UnaryPermission<T>> for UnaryPermission<T>
impl<T: PartialEq + Descriptor + Hash> PartialEq<UnaryPermission<T>> for UnaryPermission<T>
source§fn eq(&self, other: &UnaryPermission<T>) -> bool
fn eq(&self, other: &UnaryPermission<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<T: Eq + Descriptor + Hash> Eq for UnaryPermission<T>
impl<T: Descriptor + Hash> StructuralEq for UnaryPermission<T>
impl<T: Descriptor + Hash> StructuralPartialEq for UnaryPermission<T>
Auto Trait Implementations§
impl<T> RefUnwindSafe for UnaryPermission<T>where T: RefUnwindSafe,
impl<T> Send for UnaryPermission<T>where T: Send,
impl<T> Sync for UnaryPermission<T>where T: Sync,
impl<T> Unpin for UnaryPermission<T>where T: Unpin,
impl<T> UnwindSafe for UnaryPermission<T>where T: UnwindSafe,
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.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.