#[non_exhaustive]pub enum IconSupport {
Available,
Degraded {
reason: &'static str,
},
Unsupported {
reason: &'static str,
},
}Expand description
Whether this process can set its host window’s icon.
§Capability matrix
| Host | Verdict | Backend |
|---|---|---|
| Windows conhost | Available | WM_SETICON |
| Windows Terminal | Degraded | OSC 1 name only; set the profile’s icon field for a real image |
| Other Windows emulators | Degraded | OSC 1 name only |
| Linux X11 | Degraded | OSC 1 name only (_NET_WM_ICON not yet implemented) |
| Linux Wayland | Unsupported | compositors do not let a client set another window’s icon |
| macOS | Unsupported | the window belongs to Terminal.app / iTerm2, not to this process |
| No terminal | Unsupported | nothing to set an icon on |
An out-of-date row here is a documentation regression: callers decide whether to ship an icon at all based on this table.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Available
The host window accepts an icon.
Degraded
The host accepts only a symbolic name, not an image.
Reported rather than folded into Available because the difference is
visible to the user: an OSC 1 name may be shown, ignored, or applied
to something other than the window icon, and a caller told “yes” that
then sees nothing change cannot tell a failure from a terminal that
simply does not do icons.
Unsupported
It does not, and this is why.
The reason is carried so a caller can log something an operator can act on, rather than a bare boolean that invites retrying forever.
Implementations§
Source§impl IconSupport
impl IconSupport
Sourcepub fn is_available(&self) -> bool
pub fn is_available(&self) -> bool
Whether a real image icon can be set.
False for IconSupport::Degraded: a caller choosing whether to embed
and ship an icon file wants to know whether the file will be used, and
on a degraded host it will not be.
Sourcepub fn is_attemptable(&self) -> bool
pub fn is_attemptable(&self) -> bool
Whether an attempt will do something, image or not.
True for both IconSupport::Available and
IconSupport::Degraded — the distinction a caller wants when
deciding whether to bother calling at all, as opposed to whether to
ship an image.
Trait Implementations§
Source§impl Clone for IconSupport
impl Clone for IconSupport
Source§fn clone(&self) -> IconSupport
fn clone(&self) -> IconSupport
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IconSupport
impl Debug for IconSupport
impl Eq for IconSupport
Source§impl PartialEq for IconSupport
impl PartialEq for IconSupport
impl StructuralPartialEq for IconSupport
Auto Trait Implementations§
impl Freeze for IconSupport
impl RefUnwindSafe for IconSupport
impl Send for IconSupport
impl Sync for IconSupport
impl Unpin for IconSupport
impl UnsafeUnpin for IconSupport
impl UnwindSafe for IconSupport
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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)
&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)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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>
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>
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