Struct TrayIconBuilder
pub struct TrayIconBuilder { /* private fields */ }Expand description
TrayIcon builder struct and associated methods.
Implementations§
§impl TrayIconBuilder
impl TrayIconBuilder
pub fn new() -> TrayIconBuilder
pub fn new() -> TrayIconBuilder
Creates a new TrayIconBuilder with default TrayIconAttributes.
See TrayIcon::new for more info.
pub fn with_id<I>(self, id: I) -> TrayIconBuilderwhere
I: Into<TrayIconId>,
pub fn with_id<I>(self, id: I) -> TrayIconBuilderwhere
I: Into<TrayIconId>,
Sets the unique id to build the tray icon with.
Set the a menu for this tray icon.
§Platform-specific:
- Linux: once a menu is set, it cannot be removed or replaced but you can change its content.
pub fn with_icon(self, icon: Icon) -> TrayIconBuilder
pub fn with_icon(self, icon: Icon) -> TrayIconBuilder
pub fn with_tooltip<S>(self, s: S) -> TrayIconBuilder
pub fn with_tooltip<S>(self, s: S) -> TrayIconBuilder
pub fn with_title<S>(self, title: S) -> TrayIconBuilder
pub fn with_title<S>(self, title: S) -> TrayIconBuilder
Set the tray icon title.
§Platform-specific
- Linux: The title will not be shown unless there is an icon as well. The title is useful for numerical and other frequently updated information. In general, it shouldn’t be shown unless a user requests it as it can take up a significant amount of space on the user’s panel. This may not be shown in all visualizations.
- Windows: Unsupported.
pub fn with_temp_dir_path<P>(self, s: P) -> TrayIconBuilder
pub fn with_temp_dir_path<P>(self, s: P) -> TrayIconBuilder
Set tray icon temp dir path. Linux only.
On Linux, we need to write the icon to the disk and usually it will
be $XDG_RUNTIME_DIR/tray-icon or $TEMP/tray-icon.
pub fn with_icon_as_template(self, is_template: bool) -> TrayIconBuilder
pub fn with_icon_as_template(self, is_template: bool) -> TrayIconBuilder
Use the icon as a template. macOS only.
Whether to show the tray menu on left click or not, default is true.
§Platform-specific:
- Linux: Unsupported.
pub fn id(&self) -> &TrayIconId
pub fn id(&self) -> &TrayIconId
Access the unique id that will be assigned to the tray icon this builder will create.
Trait Implementations§
§impl Default for TrayIconBuilder
impl Default for TrayIconBuilder
§fn default() -> TrayIconBuilder
fn default() -> TrayIconBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for TrayIconBuilder
impl !RefUnwindSafe for TrayIconBuilder
impl !Send for TrayIconBuilder
impl !Sync for TrayIconBuilder
impl Unpin for TrayIconBuilder
impl !UnwindSafe for TrayIconBuilder
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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.§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.§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.§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.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> NoneValue for Twhere
T: Default,
impl<T> NoneValue for Twhere
T: Default,
type NoneType = T
§fn null_value() -> T
fn null_value() -> T
The none-equivalent value.
§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().