Struct trayicon::MenuBuilder
source · pub struct MenuBuilder<T>{ /* private fields */ }
Implementations§
source§impl<T> MenuBuilder<T>
impl<T> MenuBuilder<T>
Menu Builder
This is defined as consuming builder, could be converted to non-consuming
one. This builder includes conditional helper when
for composing
conditionally some items.
pub fn new() -> MenuBuilder<T>
sourcepub fn when<F>(self, f: F) -> Selfwhere
F: FnOnce(Self) -> Self,
pub fn when<F>(self, f: F) -> Selfwhere
F: FnOnce(Self) -> Self,
Conditionally include items, poor mans function composition
pub fn with(self, item: MenuItem<T>) -> Self
pub fn separator(self) -> Self
pub fn item(self, name: &str, id: T) -> Self
pub fn checkable(self, name: &str, is_checked: bool, id: T) -> Self
Trait Implementations§
source§impl<T> Clone for MenuBuilder<T>
impl<T> Clone for MenuBuilder<T>
source§fn clone(&self) -> MenuBuilder<T>
fn clone(&self) -> MenuBuilder<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl<T> Debug for MenuBuilder<T>
impl<T> Debug for MenuBuilder<T>
source§impl<T> Default for MenuBuilder<T>
impl<T> Default for MenuBuilder<T>
source§fn default() -> MenuBuilder<T>
fn default() -> MenuBuilder<T>
Returns the “default value” for a type. Read more
source§impl<T> PartialEq for MenuBuilder<T>
impl<T> PartialEq for MenuBuilder<T>
source§fn eq(&self, other: &MenuBuilder<T>) -> bool
fn eq(&self, other: &MenuBuilder<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<T> StructuralPartialEq for MenuBuilder<T>
Auto Trait Implementations§
impl<T> Freeze for MenuBuilder<T>
impl<T> RefUnwindSafe for MenuBuilder<T>where
T: RefUnwindSafe,
impl<T> Send for MenuBuilder<T>where
T: Send,
impl<T> Sync for MenuBuilder<T>where
T: Sync,
impl<T> Unpin for MenuBuilder<T>where
T: Unpin,
impl<T> UnwindSafe for MenuBuilder<T>where
T: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more