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
sourceimpl 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) -> Result<(), AnyError>
sourcepub fn check_blind(&mut self, path: &Path, display: &str) -> Result<(), AnyError>
pub fn check_blind(&mut self, path: &Path, display: &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) -> Result<(), AnyError>
sourceimpl 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) -> Result<(), AnyError>
pub fn check_all(&mut self) -> Result<(), AnyError>
sourceimpl 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>)
) -> Result<(), AnyError>
pub fn check_url(&mut self, url: &Url) -> Result<(), AnyError>
pub fn check_all(&mut self) -> Result<(), AnyError>
sourceimpl 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>
sourceimpl 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) -> Result<(), AnyError>
pub fn check_all(&mut self) -> Result<(), AnyError>
sourceimpl 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
sourceimpl<T: Clone + Eq + Hash> Clone for UnaryPermission<T>
impl<T: Clone + Eq + Hash> Clone for UnaryPermission<T>
sourcefn clone(&self) -> UnaryPermission<T>
fn clone(&self) -> UnaryPermission<T>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Default for UnaryPermission<EnvDescriptor>
impl Default for UnaryPermission<EnvDescriptor>
sourceimpl Default for UnaryPermission<FfiDescriptor>
impl Default for UnaryPermission<FfiDescriptor>
sourceimpl Default for UnaryPermission<NetDescriptor>
impl Default for UnaryPermission<NetDescriptor>
sourceimpl Default for UnaryPermission<ReadDescriptor>
impl Default for UnaryPermission<ReadDescriptor>
sourceimpl Default for UnaryPermission<RunDescriptor>
impl Default for UnaryPermission<RunDescriptor>
sourceimpl Default for UnaryPermission<WriteDescriptor>
impl Default for UnaryPermission<WriteDescriptor>
sourceimpl<T: PartialEq + Eq + Hash> PartialEq<UnaryPermission<T>> for UnaryPermission<T>
impl<T: PartialEq + Eq + Hash> PartialEq<UnaryPermission<T>> for UnaryPermission<T>
sourcefn 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 ==
. Read more
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
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more