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 AsBuilderPart for PathKind
impl AsBuilderPart for PathKind
Source§fn as_builder_part(&self) -> BuilderPart<'_>
fn as_builder_part(&self) -> BuilderPart<'_>
BuilderPart fro this value