deno_net

Trait NetPermissions

Source
pub trait NetPermissions {
    // Required methods
    fn check_net<T: AsRef<str>>(
        &mut self,
        host: &(T, Option<u16>),
        api_name: &str,
    ) -> Result<(), PermissionCheckError>;
    fn check_read(
        &mut self,
        p: &str,
        api_name: &str,
    ) -> Result<PathBuf, PermissionCheckError>;
    fn check_write(
        &mut self,
        p: &str,
        api_name: &str,
    ) -> Result<PathBuf, PermissionCheckError>;
    fn check_write_path<'a>(
        &mut self,
        p: &'a Path,
        api_name: &str,
    ) -> Result<Cow<'a, Path>, PermissionCheckError>;
}

Required Methods§

Source

fn check_net<T: AsRef<str>>( &mut self, host: &(T, Option<u16>), api_name: &str, ) -> Result<(), PermissionCheckError>

Source

fn check_read( &mut self, p: &str, api_name: &str, ) -> Result<PathBuf, PermissionCheckError>

Source

fn check_write( &mut self, p: &str, api_name: &str, ) -> Result<PathBuf, PermissionCheckError>

Source

fn check_write_path<'a>( &mut self, p: &'a Path, api_name: &str, ) -> Result<Cow<'a, Path>, PermissionCheckError>

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl NetPermissions for PermissionsContainer

Source§

fn check_net<T: AsRef<str>>( &mut self, host: &(T, Option<u16>), api_name: &str, ) -> Result<(), PermissionCheckError>

Source§

fn check_read( &mut self, path: &str, api_name: &str, ) -> Result<PathBuf, PermissionCheckError>

Source§

fn check_write( &mut self, path: &str, api_name: &str, ) -> Result<PathBuf, PermissionCheckError>

Source§

fn check_write_path<'a>( &mut self, path: &'a Path, api_name: &str, ) -> Result<Cow<'a, Path>, PermissionCheckError>

Implementors§