Enum tauri_utils::config::FsAllowlistScope
source · pub enum FsAllowlistScope {
AllowedPaths(Vec<PathBuf>),
Scope {
allow: Vec<PathBuf>,
deny: Vec<PathBuf>,
require_literal_leading_dot: Option<bool>,
},
}Expand description
Filesystem scope definition. It is a list of glob patterns that restrict the API access from the webview.
Each pattern can start with a variable that resolves to a system base directory.
The variables are: $AUDIO, $CACHE, $CONFIG, $DATA, $LOCALDATA, $DESKTOP,
$DOCUMENT, $DOWNLOAD, $EXE, $FONT, $HOME, $PICTURE, $PUBLIC, $RUNTIME,
$TEMPLATE, $VIDEO, $RESOURCE, $APP, $LOG, $TEMP, $APPCONFIG, $APPDATA,
$APPLOCALDATA, $APPCACHE, $APPLOG.
Variants§
AllowedPaths(Vec<PathBuf>)
A list of paths that are allowed by this scope.
Scope
Fields
deny: Vec<PathBuf>A list of paths that are not allowed by this scope.
This gets precedence over the Self::Scope::allow list.
require_literal_leading_dot: Option<bool>Whether or not paths that contain components that start with a .
will require that . appears literally in the pattern; *, ?, **,
or [...] will not match. This is useful because such files are
conventionally considered hidden on Unix systems and it might be
desirable to skip them when listing files.
Defaults to false on Unix systems and true on Windows
A complete scope configuration.
Implementations§
source§impl FsAllowlistScope
impl FsAllowlistScope
sourcepub fn allowed_paths(&self) -> &Vec<PathBuf>
pub fn allowed_paths(&self) -> &Vec<PathBuf>
The list of allowed paths.
sourcepub fn forbidden_paths(&self) -> Option<&Vec<PathBuf>>
pub fn forbidden_paths(&self) -> Option<&Vec<PathBuf>>
The list of forbidden paths.
Trait Implementations§
source§impl Clone for FsAllowlistScope
impl Clone for FsAllowlistScope
source§fn clone(&self) -> FsAllowlistScope
fn clone(&self) -> FsAllowlistScope
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for FsAllowlistScope
impl Debug for FsAllowlistScope
source§impl Default for FsAllowlistScope
impl Default for FsAllowlistScope
source§impl<'de> Deserialize<'de> for FsAllowlistScope
impl<'de> Deserialize<'de> for FsAllowlistScope
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl PartialEq<FsAllowlistScope> for FsAllowlistScope
impl PartialEq<FsAllowlistScope> for FsAllowlistScope
source§fn eq(&self, other: &FsAllowlistScope) -> bool
fn eq(&self, other: &FsAllowlistScope) -> bool
self and other values to be equal, and is used
by ==.