pub enum PathKind {
SetExists(PathBuf),
SetAbsent(PathBuf),
NotSet(usize),
}Expand description
Represents the presence or absence of a path
Variants§
SetExists(PathBuf)
A PathBuf that has been defined and points to a real
buffer
SetAbsent(PathBuf)
A PathBuf that has been defined but isn’t a real buffer
NotSet(usize)
A PathBuf that has not been defined
The number within represents a specific Buffer, and when
printed to, for example, the StatusLine, would show up as
txt!("[buffer]*scratch buffer*#{id}")
Implementations§
Source§impl PathKind
impl PathKind
Sourcepub fn path(&self) -> String
pub fn path(&self) -> String
The full path of the buffer.
If there is no set path, returns "*scratch buffer*#{id}".
Sourcepub fn path_set(&self) -> Option<String>
pub fn path_set(&self) -> Option<String>
The full path of the buffer.
Returns None if the path has not been set yet.
Sourcepub fn name(&self) -> String
pub fn name(&self) -> String
The buffer’s name.
If there is no set path, returns "*scratch buffer #{id}*".
Sourcepub fn name_set(&self) -> Option<String>
pub fn name_set(&self) -> Option<String>
The buffer’s name.
Returns None if the path has not been set yet.
Sourcepub fn name_txt(&self) -> Text
pub fn name_txt(&self) -> Text
A Text from the name of this PathKind
The name of a Buffer widget is the same as the path, but
it strips away the current directory. If it can’t, it will
try to strip away the home directory, replacing it with
"~". If that also fails, it will just show the full
path.
§Formatting
If the buffer’s name was set:
[buffer]{name}If the buffer’s name was not set:
[buffer.new.scratch]*scratch buffer #{id}*Trait Implementations§
Source§impl From<PathKind> for BuilderPart
impl From<PathKind> for BuilderPart
impl Eq for PathKind
Auto Trait Implementations§
impl Freeze for PathKind
impl RefUnwindSafe for PathKind
impl Send for PathKind
impl Sync for PathKind
impl Unpin for PathKind
impl UnwindSafe for PathKind
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
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.