pub struct LabeledTable { /* private fields */ }Expand description
Typed builder for labeled-row tables. Renders Nord-styled
right-aligned label value rows + sections + nested lists.
Implementations§
Source§impl LabeledTable
impl LabeledTable
Sourcepub fn new(label_w: usize) -> Self
pub fn new(label_w: usize) -> Self
Construct a new table with the given right-aligned label width (typically 14 across the inventory binary).
Sourcepub fn kv(self, key: &str, value: &str) -> Self
pub fn kv(self, key: &str, value: &str) -> Self
Add a required key-value row. Value renders as ident().
Sourcepub fn opt(self, key: &str, value: Option<&str>) -> Self
pub fn opt(self, key: &str, value: Option<&str>) -> Self
Add an optional key-value row. Present values render
as info(), absent as muted("(none)").
Sourcepub fn section(self, title: &str, count: Option<usize>) -> Self
pub fn section(self, title: &str, count: Option<usize>) -> Self
Add a section header with an optional count chip.
Sourcepub fn list_items<I, S>(self, glyph: &str, items: I) -> Self
pub fn list_items<I, S>(self, glyph: &str, items: I) -> Self
Add a list of nested rows under the most recent section.
Each item is prefixed with glyph and styled success().
Auto Trait Implementations§
impl Freeze for LabeledTable
impl RefUnwindSafe for LabeledTable
impl Send for LabeledTable
impl Sync for LabeledTable
impl Unpin for LabeledTable
impl UnsafeUnpin for LabeledTable
impl UnwindSafe for LabeledTable
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.