[][src]Struct starship::module::Module

pub struct Module<'a> { /* fields omitted */ }

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]

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

impl<'a> Display for Module<'a>[src]

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]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self