#[non_exhaustive]pub struct JobBadge {
pub icon: String,
pub tone: Option<Tone>,
pub tip: String,
}Expand description
A symbol drawn before a job’s title (the node a remote job runs on, a
state): a registry icon’s name (phosphor:hard-drives), its tone, and
its tooltip, which is also its accessible name, so a screen reader
hears what the symbol means. Given by job.started or job.progress
as badge:
{ "icon": "phosphor:hard-drives", "tone": "muted", "tip": "On the NAS" }An icon the registry does not know draws its placeholder.
use egui_pop_model::admin::Tone;
use egui_pop_model::jobs::JobBadge;
use serde_json::json;
let badge = JobBadge::new("phosphor:hard-drives", "On the NAS").tone(Tone::Muted);
let data = json!({ "icon": "phosphor:hard-drives", "tone": "muted", "tip": "On the NAS" });
assert_eq!(serde_json::to_value(&badge).unwrap(), data);
assert_eq!(JobBadge::of(&data), Some(badge));Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.icon: StringA registry icon’s name.
tone: Option<Tone>Its tone; the text’s when none.
tip: StringWhat it means: its tooltip and its accessible name.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for JobBadge
impl<'de> Deserialize<'de> for JobBadge
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for JobBadge
Auto Trait Implementations§
impl Freeze for JobBadge
impl RefUnwindSafe for JobBadge
impl Send for JobBadge
impl Sync for JobBadge
impl Unpin for JobBadge
impl UnsafeUnpin for JobBadge
impl UnwindSafe for JobBadge
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