Struct lazybar_core::bar::Bar

source ·
pub struct Bar { /* private fields */ }
Expand description

The bar itself.

See parser::parse for configuration details.

Implementations§

source§

impl Bar

source

pub fn new( name: String, position: Position, height: u16, transparent: bool, bg: Color, margins: Margins, reverse_scroll: bool, ipc: bool, monitor: Option<String>, ) -> Result<(Self, Pin<Box<dyn Stream<Item = Result<UnixStream, Error>>>>)>

Create a new bar, typically from information held by a BarConfig.

source

pub async fn process_event(&mut self, event: &Event) -> Result<()>

Handle an event from the X server.

source

pub fn send_message( &mut self, message: &str, ipc_set: &mut JoinSet<Result<()>>, ipc_send: UnboundedSender<EventResponse>, ) -> Result<bool>

Given a message, find the endpoint of the panel it’s addressed to.

source

pub fn update_panel( &mut self, alignment: Alignment, idx: usize, draw_info: PanelDrawInfo, ) -> Result<()>

Handle a change in the content of a panel.

source

pub fn redraw_bar(&mut self) -> Result<()>

Redraw the entire bar, either as the result of an expose event or because the width of a panel changed.

Note: this function is not called for every panel update. If the width doesn’t change, only one panel is redrawn, and there are a number of other cases in which we can redraw only the left or right side. See Bar::update_panel for specifics.

Auto Trait Implementations§

§

impl Freeze for Bar

§

impl !RefUnwindSafe for Bar

§

impl !Send for Bar

§

impl !Sync for Bar

§

impl Unpin for Bar

§

impl !UnwindSafe for Bar

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

source§

fn vzip(self) -> V