[−][src]Struct starship::module::Module
A module is a collection of segments showing data for a single integration (e.g. The git module shows the current git branch and status)
Methods
impl<'a> Module<'a>
[src]
pub fn new(name: &str, config: Option<&'a Table>) -> Module<'a>
[src]
Creates a module with no segments.
pub fn new_segment(&mut self, name: &str, value: &str) -> &mut Segment
[src]
Get a reference to a newly created segment in the module
pub fn is_empty(&self) -> bool
[src]
Whether a module has any segments
pub fn get_prefix(&mut self) -> &mut Affix
[src]
Get the module's prefix
pub fn get_suffix(&mut self) -> &mut Affix
[src]
Get the module's suffix
pub fn set_style<T>(&mut self, style: T) -> &mut Module<'a> where
T: Into<Style>,
[src]
T: Into<Style>,
Sets the style of the segment.
Accepts either Color
or Style
.
pub fn ansi_strings(&self) -> Vec<ANSIString>
[src]
Returns a vector of colored ANSIString elements to be later used with
ANSIStrings()
to optimize ANSI codes
pub fn to_string_without_prefix(&self) -> String
[src]
pub fn config_value_str(&self, key: &str) -> Option<&str>
[src]
Get a module's config value as a string
pub fn config_value_i64(&self, key: &str) -> Option<i64>
[src]
Get a module's config value as an int
pub fn config_value_bool(&self, key: &str) -> Option<bool>
[src]
Get a module's config value as a bool
Trait Implementations
Auto Trait Implementations
impl<'a> Sync for Module<'a>
impl<'a> Send for Module<'a>
impl<'a> Unpin for Module<'a>
impl<'a> RefUnwindSafe for Module<'a>
impl<'a> UnwindSafe for Module<'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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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