pub struct AppBarItem { /* private fields */ }Expand description
One action with an inline representation and an overflow menu representation.
Implementations§
Source§impl AppBarItem
impl AppBarItem
Sourcepub fn clickable<E: IntoElement>(
id: impl Into<ElementId>,
label: impl Into<SharedString>,
icon: impl Fn() -> E + 'static,
) -> Self
pub fn clickable<E: IntoElement>( id: impl Into<ElementId>, label: impl Into<SharedString>, icon: impl Fn() -> E + 'static, ) -> Self
Creates an icon button and a matching named menu command. The icon factory may be called for either representation.
Sourcepub fn custom(
id: impl Into<ElementId>,
inline: impl IntoElement,
menu: impl FnOnce(AppBarMenuState) -> MenuItem + 'static,
) -> Self
pub fn custom( id: impl Into<ElementId>, inline: impl IntoElement, menu: impl FnOnce(AppBarMenuState) -> MenuItem + 'static, ) -> Self
Supplies an inline element and the corresponding Material menu item.
Sourcepub fn disabled(self, disabled: bool) -> Self
pub fn disabled(self, disabled: bool) -> Self
Disables the action in both its inline and overflow menu representations.
Sourcepub fn on_activate(
self,
action: impl Fn(&mut Window, &mut App) + 'static,
) -> Self
pub fn on_activate( self, action: impl Fn(&mut Window, &mut App) + 'static, ) -> Self
Sets the activation callback for both representations of a clickable item.
Auto Trait Implementations§
impl !RefUnwindSafe for AppBarItem
impl !Send for AppBarItem
impl !Sync for AppBarItem
impl !UnwindSafe for AppBarItem
impl Forget for AppBarItem
impl Freeze for AppBarItemwhere
NonZero<u32>: Freeze,
&'static str: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
*const ArcInner<Path> is !null: Freeze,
PhantomData<ArcInner<Path>>: Freeze,
*const str is !null: Freeze,
PhantomData<&'static str>: Freeze,
*const ArcInner<ElementId> is !null: Freeze,
PhantomData<ArcInner<ElementId>>: Freeze,
*const RcInner<dyn Fn() -> AnyElement> is !null: Freeze,
PhantomData<RcInner<dyn Fn() -> AnyElement>>: Freeze,
*const RcInner<dyn Fn(&mut Window, &mut App)> is !null: Freeze,
PhantomData<RcInner<dyn Fn(&mut Window, &mut App)>>: Freeze,
*mut dyn ElementObject: Freeze,
*const RcInner<Cell<bool>> is !null: Freeze,
PhantomData<RcInner<Cell<bool>>>: Freeze,
*const dyn FnOnce(AppBarMenuState) -> MenuItem is !null: Freeze,
PhantomData<dyn FnOnce(AppBarMenuState) -> MenuItem>: Freeze,
impl Move for AppBarItem
impl Unpin for AppBarItemwhere
NonZero<u32>: Unpin,
&'static str: Unpin,
Arc<str>: Unpin,
Arc<Path>: Unpin,
*const str is !null: Unpin,
Arc<ElementId>: Unpin,
Rc<dyn Fn() -> AnyElement>: Unpin,
Rc<dyn Fn(&mut Window, &mut App)>: Unpin,
*mut dyn ElementObject: Unpin,
Rc<Cell<bool>>: Unpin,
Box<dyn FnOnce(AppBarMenuState) -> MenuItem>: Unpin,
impl UnsafeUnpin for AppBarItemwhere
NonZeroU32Inner: UnsafeUnpin,
&'static str: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
*const ArcInner<Path> is !null: UnsafeUnpin,
PhantomData<ArcInner<Path>>: UnsafeUnpin,
*const str is !null: UnsafeUnpin,
PhantomData<&'static str>: UnsafeUnpin,
*const ArcInner<ElementId> is !null: UnsafeUnpin,
PhantomData<ArcInner<ElementId>>: UnsafeUnpin,
*const RcInner<dyn Fn() -> AnyElement> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn() -> AnyElement>>: UnsafeUnpin,
*const RcInner<dyn Fn(&mut Window, &mut App)> is !null: UnsafeUnpin,
PhantomData<RcInner<dyn Fn(&mut Window, &mut App)>>: UnsafeUnpin,
*mut dyn ElementObject: UnsafeUnpin,
*const RcInner<Cell<bool>> is !null: UnsafeUnpin,
PhantomData<RcInner<Cell<bool>>>: UnsafeUnpin,
*const dyn FnOnce(AppBarMenuState) -> MenuItem is !null: UnsafeUnpin,
PhantomData<dyn FnOnce(AppBarMenuState) -> MenuItem>: UnsafeUnpin,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more