Struct deno_runtime::permissions::UnaryPermission
source · pub struct UnaryPermission<T: Eq + Hash> {
pub name: &'static str,
pub description: &'static str,
pub global_state: PermissionState,
pub granted_list: HashSet<T>,
pub denied_list: HashSet<T>,
pub prompt: bool,
}
Fields§
§name: &'static str
§description: &'static str
§global_state: PermissionState
§granted_list: HashSet<T>
§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>
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_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: Option<&Path>) -> Result<(), AnyError>
pub fn check_all(&mut self) -> Result<(), AnyError>
Trait Implementations§
source§impl<T: Clone + Eq + Hash> Clone for UnaryPermission<T>
impl<T: Clone + Eq + 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 Default for UnaryPermission<EnvDescriptor>
impl Default for UnaryPermission<EnvDescriptor>
source§impl Default for UnaryPermission<FfiDescriptor>
impl Default for UnaryPermission<FfiDescriptor>
source§impl Default for UnaryPermission<NetDescriptor>
impl Default for UnaryPermission<NetDescriptor>
source§impl Default for UnaryPermission<ReadDescriptor>
impl Default for UnaryPermission<ReadDescriptor>
source§impl Default for UnaryPermission<RunDescriptor>
impl Default for UnaryPermission<RunDescriptor>
source§impl Default for UnaryPermission<SysDescriptor>
impl Default for UnaryPermission<SysDescriptor>
source§impl Default for UnaryPermission<WriteDescriptor>
impl Default for UnaryPermission<WriteDescriptor>
source§impl<T: PartialEq + Eq + Hash> PartialEq<UnaryPermission<T>> for UnaryPermission<T>
impl<T: PartialEq + Eq + 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 + Eq + Hash> Eq for UnaryPermission<T>
impl<T: Eq + Hash> StructuralEq for UnaryPermission<T>
impl<T: Eq + 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§
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.