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
A complete scope configuration.
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 true
on Unix systems and false
on Windows
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 for FsAllowlistScope
impl PartialEq for FsAllowlistScope
source§impl Serialize for FsAllowlistScope
impl Serialize for FsAllowlistScope
impl Eq for FsAllowlistScope
impl StructuralPartialEq for FsAllowlistScope
Auto Trait Implementations§
impl Freeze for FsAllowlistScope
impl RefUnwindSafe for FsAllowlistScope
impl Send for FsAllowlistScope
impl Sync for FsAllowlistScope
impl Unpin for FsAllowlistScope
impl UnwindSafe for FsAllowlistScope
Blanket Implementations§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.