pub struct SourcePath { /* private fields */ }Expand description
A path in a source’s own style: what a picker lists, what it asks a source for, and what it reports as chosen.
The text is the path as the source writes it, with no trailing
separator except after a root. Two paths are equal when they name the
same place in their style, so C:/Users/Me equals c:\users\me in a
Windows style. A path made for the local disk converts with
to_path_buf; a remote one is only text.
Implementations§
Source§impl SourcePath
impl SourcePath
Sourcepub fn new(text: &str, style: PathStyle) -> Self
pub fn new(text: &str, style: PathStyle) -> Self
The path text names in style. Separators become the style’s
own, and a trailing separator goes unless it follows a root.
Sourcepub fn parent(&self) -> Option<SourcePath>
pub fn parent(&self) -> Option<SourcePath>
The path above this one, or None for a root. A Windows-style
source with a computer root has it above a drive root.
Sourcepub fn join(&self, name: &str) -> SourcePath
pub fn join(&self, name: &str) -> SourcePath
The path of name inside this one.
Sourcepub fn is_root(&self) -> bool
pub fn is_root(&self) -> bool
Whether this is a root: /, a drive, a share, or the root above
the drives.
Sourcepub fn to_path_buf(&self) -> PathBuf
pub fn to_path_buf(&self) -> PathBuf
The path as the local disk reads it. It is meaningful for a source that lists the local disk; for a remote source it is only the text.
Trait Implementations§
Source§impl Clone for SourcePath
impl Clone for SourcePath
Source§impl Debug for SourcePath
impl Debug for SourcePath
Source§impl Display for SourcePath
impl Display for SourcePath
impl Eq for SourcePath
Source§impl Hash for SourcePath
impl Hash for SourcePath
Auto Trait Implementations§
impl Freeze for SourcePath
impl RefUnwindSafe for SourcePath
impl Send for SourcePath
impl Sync for SourcePath
impl Unpin for SourcePath
impl UnsafeUnpin for SourcePath
impl UnwindSafe for SourcePath
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more