Enum unidirs::UnifiedDirs
source · pub enum UnifiedDirs {
Local(LocalDirs),
Service(ServiceDirs),
User(UserDirs),
}
Expand description
Unified directories provide a common interface over all different ways of constructing directory providers. It provides constructors for each variant.
The most significant function is UnifiedDirs::simple
, giving an automatic selector for the
right directory provider based on the way an application is run.
Variants§
Local(LocalDirs)
Local directories for development.
Service(ServiceDirs)
Directories for applications run as service.
User(UserDirs)
User specific application folders.
Implementations§
source§impl UnifiedDirs
impl UnifiedDirs
sourcepub fn local_at(base: impl AsRef<Utf8Path>) -> Self
pub fn local_at(base: impl AsRef<Utf8Path>) -> Self
Shorthand to create LocalDirs
backed unified dirs at a specific location.
sourcepub fn service(
organization: impl AsRef<str>,
application: impl AsRef<str>
) -> Self
pub fn service( organization: impl AsRef<str>, application: impl AsRef<str> ) -> Self
Shorthand to create unified dirs with ServiceDirs
as backend.
sourcepub fn user(
qualifier: impl AsRef<str>,
organization: impl AsRef<str>,
application: impl AsRef<str>
) -> Option<Self>
pub fn user( qualifier: impl AsRef<str>, organization: impl AsRef<str>, application: impl AsRef<str> ) -> Option<Self>
Shorthand to create unified dirs with UserDirs
as backend.
sourcepub fn simple<Q, O, A>(
qualifier: Q,
organization: O,
application: A
) -> SimpleBuilder<Q, O, A>where
Q: AsRef<str>,
O: AsRef<str>,
A: AsRef<str>,
pub fn simple<Q, O, A>( qualifier: Q, organization: O, application: A ) -> SimpleBuilder<Q, O, A>where Q: AsRef<str>, O: AsRef<str>, A: AsRef<str>,
Create a builder for unified directories that uses various detection techniques to select
the right backend. See the SimpleBuilder
implementation for more details about the
used techniques.
Trait Implementations§
source§impl Clone for UnifiedDirs
impl Clone for UnifiedDirs
source§fn clone(&self) -> UnifiedDirs
fn clone(&self) -> UnifiedDirs
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for UnifiedDirs
impl Debug for UnifiedDirs
source§impl Directories for UnifiedDirs
impl Directories for UnifiedDirs
source§fn cache_dir(&self) -> &Utf8Path
fn cache_dir(&self) -> &Utf8Path
source§fn config_dir(&self) -> &Utf8Path
fn config_dir(&self) -> &Utf8Path
source§impl Hash for UnifiedDirs
impl Hash for UnifiedDirs
source§impl Ord for UnifiedDirs
impl Ord for UnifiedDirs
source§fn cmp(&self, other: &UnifiedDirs) -> Ordering
fn cmp(&self, other: &UnifiedDirs) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere Self: Sized,
source§impl PartialEq<UnifiedDirs> for UnifiedDirs
impl PartialEq<UnifiedDirs> for UnifiedDirs
source§fn eq(&self, other: &UnifiedDirs) -> bool
fn eq(&self, other: &UnifiedDirs) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd<UnifiedDirs> for UnifiedDirs
impl PartialOrd<UnifiedDirs> for UnifiedDirs
source§fn partial_cmp(&self, other: &UnifiedDirs) -> Option<Ordering>
fn partial_cmp(&self, other: &UnifiedDirs) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more