tauri_plugin_fs

Struct Scope

source
pub struct Scope { /* private fields */ }

Implementations§

source§

impl Scope

source

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.

source

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.

source

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.

source

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.

source

pub fn allowed(&self) -> Vec<PathBuf>

List of allowed paths.

source

pub fn forbidden(&self) -> Vec<PathBuf>

List of forbidden paths.

source

pub fn listen<F: Fn(&Event) + Send + 'static>(&self, f: F) -> u32

Listen to an event on this scope.

Trait Implementations§

source§

impl Default for Scope

source§

fn default() -> Scope

Returns the “default value” for a type. Read more

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> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.