Skip to main content

Item

Struct Item 

Source
pub struct Item<M> { /* private fields */ }
Expand description

What a widget shows in the bar.

Implementations§

Source§

impl<M> Item<M>

Source

pub fn new(content: Node<M>) -> Self

Source

pub fn hidden() -> Self

Takes no space in the bar. For widgets with nothing to show, like a battery on a desktop.

Source

pub fn on_press(self, message: M) -> Self

Sent on a primary click. Replaces the default of toggling the popover.

Source

pub fn on_secondary(self, message: M) -> Self

Sent on a secondary (right) click.

Source

pub fn on_scroll(self, up: M, down: M) -> Self

Sent once per scroll step over the item, up or down. The host turns smooth touchpad scrolling into steps.

Source

pub fn map<N: 'static>(self, f: &(impl Fn(M) -> N + Clone + 'static)) -> Item<N>
where M: 'static,

Auto Trait Implementations§

§

impl<M> !RefUnwindSafe for Item<M>

§

impl<M> !Send for Item<M>

§

impl<M> !Sync for Item<M>

§

impl<M> !UnwindSafe for Item<M>

§

impl<M> Freeze for Item<M>

§

impl<M> Unpin for Item<M>

§

impl<M> UnsafeUnpin for Item<M>

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>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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.