pub struct PairItem {
pub id: String,
pub name: String,
pub detail: Option<String>,
pub icon: Option<String>,
}Expand description
A single item rendered in either column of a Pairing widget.
Fields§
§id: StringStable identifier. Used as the link key when pairing items across sides.
name: StringPrimary label shown on the node.
detail: Option<String>Optional secondary text rendered below the name.
icon: Option<String>Optional leading-edge glyph rendered in a small rounded box.
Implementations§
Source§impl PairItem
impl PairItem
Sourcepub fn new(id: impl Into<String>, name: impl Into<String>) -> Self
pub fn new(id: impl Into<String>, name: impl Into<String>) -> Self
Create a new item with a stable id and display name.
Sourcepub fn icon(self, icon: impl Into<String>) -> Self
pub fn icon(self, icon: impl Into<String>) -> Self
Set the leading icon glyph.
Rendered with the default proportional font. The bundled
Elegance Symbols fallback font only covers arrows (← ↑ → ↓ ↩ ↲ ↵),
ellipses (⋮ ⋯), modifier keys (⌃ ⌘ ⌥ ⌫ ⌦), triangles (▴ ▸ ▾ ◂)
and ✓ ✗. Glyphs outside that set (e.g. ◈, ↗) may render as tofu
unless the host app has registered a font that covers them.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PairItem
impl RefUnwindSafe for PairItem
impl Send for PairItem
impl Sync for PairItem
impl Unpin for PairItem
impl UnsafeUnpin for PairItem
impl UnwindSafe for PairItem
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