tauri::path

Enum BaseDirectory

source
#[non_exhaustive]
#[repr(u16)]
pub enum BaseDirectory {
Show 23 variants Audio = 1, Cache = 2, Config = 3, Data = 4, LocalData = 5, Document = 6, Download = 7, Picture = 8, Public = 9, Video = 10, Resource = 11, Temp = 12, AppConfig = 13, AppData = 14, AppLocalData = 15, AppCache = 16, AppLog = 17, Desktop = 18, Executable = 19, Font = 20, Home = 21, Runtime = 22, Template = 23,
}
Expand description

A base directory for a path.

The base directory is the optional root of a file system operation. If informed by the API call, all paths will be relative to the path of the given directory.

For more information, check the dirs documentation.

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Audio = 1

The Audio directory.

§

Cache = 2

The Cache directory.

§

Config = 3

The Config directory.

§

Data = 4

The Data directory.

§

LocalData = 5

The LocalData directory.

§

Document = 6

The Document directory.

§

Download = 7

The Download directory.

§

Picture = 8

The Picture directory.

§

Public = 9

The Public directory.

§

Video = 10

The Video directory.

§

Resource = 11

The Resource directory.

§

Temp = 12

A temporary directory. Resolves to std::env::temp_dir.

§

AppConfig = 13

The default app config directory. Resolves to BaseDirectory::Config/{bundle_identifier}.

§

AppData = 14

The default app data directory. Resolves to BaseDirectory::Data/{bundle_identifier}.

§

AppLocalData = 15

The default app local data directory. Resolves to BaseDirectory::LocalData/{bundle_identifier}.

§

AppCache = 16

The default app cache directory. Resolves to BaseDirectory::Cache/{bundle_identifier}.

§

AppLog = 17

The default app log directory. Resolves to BaseDirectory::Home/Library/Logs/{bundle_identifier} on macOS and BaseDirectory::Config/{bundle_identifier}/logs on linux and Windows.

§

Desktop = 18

The Desktop directory.

§

Executable = 19

The Executable directory.

§

Font = 20

The Font directory.

§

Home = 21

The Home directory.

§

Runtime = 22

The Runtime directory.

§

Template = 23

The Template directory.

Implementations§

source§

impl BaseDirectory

source

pub fn variable(self) -> &'static str

Gets the variable that represents this BaseDirectory for string paths.

source

pub fn from_variable(variable: &str) -> Option<Self>

Gets the BaseDirectory associated with the given variable, or None if the variable doesn’t match any.

Trait Implementations§

source§

impl Clone for BaseDirectory

source§

fn clone(&self) -> BaseDirectory

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for BaseDirectory

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for BaseDirectory

source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Serialize for BaseDirectory

source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for BaseDirectory

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<'de, D, R> CommandArg<'de, R> for D
where D: Deserialize<'de>, R: Runtime,

source§

fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>

Derives an instance of Self from the CommandItem. 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> IpcResponse for T
where T: Serialize,

source§

fn body(self) -> Result<InvokeResponseBody, Error>

Resolve the IPC response body.
source§

impl<T> ScopeObject for T
where T: Send + Sync + Debug + DeserializeOwned + 'static,

source§

type Error = Error

The error type.
source§

fn deserialize<R>( _app: &AppHandle<R>, raw: Value, ) -> Result<T, <T as ScopeObject>::Error>
where R: Runtime,

Deserialize the raw scope value.
source§

impl<T> Serialize for T
where T: Serialize + ?Sized,

source§

fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>

source§

fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

source§

impl<T> UserEvent for T
where T: Debug + Clone + Send + 'static,