[][src]Struct rust_bitbar::SubMenu

pub struct SubMenu {
    pub level: i64,
    pub lines: Vec<SubMenuItem>,
}

SubMenu contains a slice of SubMenuItems which can be Lines or additional SubMenus. The Level indicates how nested the submenu is which is used during render to prepend the correct number of -- prefixes.

Fields

level: i64lines: Vec<SubMenuItem>

Methods

impl SubMenu[src]

pub fn new() -> Self[src]

Function to create empty sub menu

pub fn add_line(&mut self, line: Line) -> &mut Self[src]

Line creates a line adding text to the dropdown which will be added after the main dropdown delimiter (---).

pub fn add_sub_menu(&mut self, sub_menu: SubMenu) -> &mut Self[src]

NewSubMenu creates a nested submenu off a submenu.

pub fn add_hr(&mut self) -> &mut Self[src]

HR turns a line into a horizontal delimiter, useful for breaking menu items into logical groups.

Auto Trait Implementations

impl Send for SubMenu

impl Sync for SubMenu

Blanket Implementations

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

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

impl<T, U> TryInto 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> Any for T where
    T: 'static + ?Sized
[src]