pub struct Tray { /* private fields */ }Expand description
The app’s tray icon: give it to the backend’s services and pass
Services::set_tray on.
Implementations§
Source§impl Tray
impl Tray
Sourcepub fn new(on_token: impl Fn(String) + 'static) -> Tray
pub fn new(on_token: impl Fn(String) + 'static) -> Tray
on_token gets a host’s activation token for a menu click, just
before the item runs: the backend brings forward with it the window
the item presents or opens.
Sourcepub fn set_app_id(&self, id: Option<&str>)
pub fn set_app_id(&self, id: Option<&str>)
The app’s id: the icon theme’s name for the app’s own icon, shown
when the app gives none, and the item’s Id.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Tray
impl !Send for Tray
impl !Sync for Tray
impl !UnwindSafe for Tray
impl Forget for Tray
impl Freeze for Tray
impl Move for Tray
impl Unpin for Tray
impl UnsafeUnpin for Traywhere
*const RcInner<RefCell<State>> is !null: UnsafeUnpin,
PhantomData<RcInner<RefCell<State>>>: 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
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.