#[non_exhaustive]pub struct DataTableGlyphs { /* private fields */ }Expand description
Optional app-supplied override for the sort-direction glyphs
native_surface_paint appends to a sorted column’s header title.
A separate, #[non_exhaustive] type rather than fields on
DataTable — that descriptor stays exhaustive for downstream
struct literals, so a glyph slot can only ever be added here.
Passed as an extra argument to the GUI paint module’s
paint_with_glyphs; the plain paint every existing backend call
site already uses keeps calling it with None, so today’s codicon
sort arrows render byte-for-byte unchanged until an app opts in.
Each slot is an Icon — glyph for when
crate::Backend::nerd_fonts_enabled is set, fallback otherwise
— rather than a bare string. A bare &str/String still works via
Icon’s blanket From impls.
Unlike crate::primitives::context_menu::ContextMenuGlyphs and
crate::primitives::tab_bar::TabBarGlyphs — both of which paint a
single terminal cell and so take only the resolved string’s first
char — the TUI rasteriser splices this override’s whole resolved
&str into the column-header title, so a multi-character glyph is
not truncated here. Icon::color is resolved but not painted on
TUI either way: the header always uses the theme’s header
foreground colour.
Implementations§
Source§impl DataTableGlyphs
impl DataTableGlyphs
Sourcepub fn new() -> Self
pub fn new() -> Self
An empty override set — painting with Some(&Self::new()) is
byte-identical to painting with None.
Sourcepub fn with_sort_ascending_glyph(self, glyph: impl Into<Icon>) -> Self
pub fn with_sort_ascending_glyph(self, glyph: impl Into<Icon>) -> Self
Override the ascending-sort glyph (default: the codicon sort-ascending glyph on GUI).
Sourcepub fn with_sort_descending_glyph(self, glyph: impl Into<Icon>) -> Self
pub fn with_sort_descending_glyph(self, glyph: impl Into<Icon>) -> Self
Override the descending-sort glyph (default: the codicon sort-descending glyph on GUI).
Sourcepub fn sort_ascending_glyph(&self) -> Option<&Icon>
pub fn sort_ascending_glyph(&self) -> Option<&Icon>
The overridden ascending-sort glyph, if set.
Sourcepub fn sort_descending_glyph(&self) -> Option<&Icon>
pub fn sort_descending_glyph(&self) -> Option<&Icon>
The overridden descending-sort glyph, if set.
Trait Implementations§
Source§impl Clone for DataTableGlyphs
impl Clone for DataTableGlyphs
Source§impl Debug for DataTableGlyphs
impl Debug for DataTableGlyphs
Source§impl Default for DataTableGlyphs
impl Default for DataTableGlyphs
impl Eq for DataTableGlyphs
Source§impl PartialEq for DataTableGlyphs
impl PartialEq for DataTableGlyphs
impl StructuralPartialEq for DataTableGlyphs
Auto Trait Implementations§
impl Freeze for DataTableGlyphs
impl RefUnwindSafe for DataTableGlyphs
impl Send for DataTableGlyphs
impl Sync for DataTableGlyphs
impl Unpin for DataTableGlyphs
impl UnsafeUnpin for DataTableGlyphs
impl UnwindSafe for DataTableGlyphs
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
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