Enum tauri::api::path::BaseDirectory

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

A base directory to be used in resolve_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_next 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.

§

Desktop = 6

The Desktop directory.

§

Document = 7

The Document directory.

§

Download = 8

The Download directory.

§

Executable = 9

The Executable directory.

§

Font = 10

The Font directory.

§

Home = 11

The Home directory.

§

Picture = 12

The Picture directory.

§

Public = 13

The Public directory.

§

Runtime = 14

The Runtime directory.

§

Template = 15

The Template directory.

§

Video = 16

The Video directory.

§

Resource = 17

The Resource directory.

§

App = 18

👎Deprecated since 1.2.0: Will be removed in 2.0.0. Use BaseDirectory::AppConfig or BaseDirectory::AppData` instead.

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

§

Log = 19

👎Deprecated since 1.2.0: Will be removed in 2.0.0. Use BaseDirectory::AppLog instead.

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.

§

Temp = 20

A temporary directory. Resolves to temp_dir.

§

AppConfig = 21

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

§

AppData = 22

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

§

AppLocalData = 23

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

§

AppCache = 24

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

§

AppLog = 25

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.

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<'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> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

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

§

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>,

§

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>,

§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

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

source§

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