[−][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: StarshipConfig
The deserialized configuration map from the user's starship.toml
file.
current_dir: PathBuf
The current working directory that starship is being called in.
properties: HashMap<&'a str, String>
Properties to provide to modules.
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) -> Module
[src]
Create a new module
pub fn is_module_disabled_in_config(&self, name: &str) -> bool
[src]
Check if disabled
option of the module is true in configuration file.
pub fn try_begin_scan(&'a self) -> Option<ScanDir<'a>>
[src]
pub fn get_repo(&self) -> Result<&Repo, Error>
[src]
Will lazily get repo root and branch when a module requests it.
pub fn get_dir_files(&self) -> Result<&Vec<PathBuf>, Error>
[src]
Auto Trait Implementations
impl<'a> Send for Context<'a>
impl<'a> Sync for Context<'a>
impl<'a> Unpin for Context<'a>
impl<'a> UnwindSafe for Context<'a>
impl<'a> RefUnwindSafe for Context<'a>
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
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