[−][src]Struct starship::context::Context
Context contains data or common methods that may be used by multiple modules. The data contained within Context will be relevant to this particular rendering of the prompt.
Fields
config: Table
The deserialized configuration map from the user's starship.toml
file.
current_dir: PathBuf
The current working directory that starship is being called in.
dir_files: Vec<PathBuf>
A vector containing the full paths of all the files in current_dir
.
arguments: ArgMatches<'a>
The map of arguments that were passed when starship was called.
repo_root: Option<PathBuf>
If current_dir
is a git repository or is contained within one,
this is the path to the root of that repo.
branch_name: Option<String>
If current_dir
is a git repository or is contained within one,
this is the current branch name of that repo.
Methods
impl<'a> Context<'a>
[src]
pub fn new(arguments: ArgMatches) -> Context
[src]
Identify the current working directory and create an instance of Context for it.
pub fn new_with_dir<T>(arguments: ArgMatches, dir: T) -> Context where
T: Into<PathBuf>,
[src]
T: Into<PathBuf>,
Create a new instance of Context for the provided directory
pub fn new_module(&self, name: &str) -> Option<Module>
[src]
Create a new module
Will return None
if the module is disabled by configuration, by setting
the disabled
key to true
in the configuration for that module.
pub fn new_scan_dir(&'a self) -> ScanDir<'a>
[src]
Auto Trait Implementations
impl<'a> Sync for Context<'a>
impl<'a> Send for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> RefUnwindSafe for Context<'a>
impl<'a> UnwindSafe for Context<'a>
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Same<T> for T
type Output = T
Should always be Self