pub struct Scope { /* private fields */ }
Implementations§
source§impl Scope
impl Scope
sourcepub fn allow_directory<P: AsRef<Path>>(&self, path: P, recursive: bool)
pub fn allow_directory<P: AsRef<Path>>(&self, path: P, recursive: bool)
Extend the allowed patterns with the given directory.
After this function has been called, the frontend will be able to use the Tauri API to read
the directory and all of its files. If recursive
is true
, subdirectories will be accessible too.
sourcepub fn allow_file<P: AsRef<Path>>(&self, path: P)
pub fn allow_file<P: AsRef<Path>>(&self, path: P)
Extend the allowed patterns with the given file path.
After this function has been called, the frontend will be able to use the Tauri API to read the contents of this file.
sourcepub fn forbid_directory<P: AsRef<Path>>(&self, path: P, recursive: bool)
pub fn forbid_directory<P: AsRef<Path>>(&self, path: P, recursive: bool)
Set the given directory path to be forbidden by this scope.
Note: this takes precedence over allowed paths, so its access gets denied always.
sourcepub fn forbid_file<P: AsRef<Path>>(&self, path: P)
pub fn forbid_file<P: AsRef<Path>>(&self, path: P)
Set the given file path to be forbidden by this scope.
Note: this takes precedence over allowed paths, so its access gets denied always.
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for Scope
impl RefUnwindSafe for Scope
impl Send for Scope
impl Sync for Scope
impl Unpin for Scope
impl UnwindSafe for Scope
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
Mutably borrows from an owned value. Read more