pub enum Component {
Heading {
text: String,
},
KvBlock {
pairs: Vec<KvPair>,
},
Bullet {
text: String,
},
Status {
role: Role,
subject: String,
detail: Option<String>,
duration_ms: Option<u128>,
target: Option<String>,
label: Option<StatusLabel>,
},
Hint {
text: String,
},
Note {
text: String,
},
Table {
headers: Vec<String>,
rows: Vec<Vec<String>>,
row_roles: Vec<Vec<Option<Role>>>,
},
Section {
name: String,
keep_when_empty: bool,
empty_state: Option<String>,
children: Vec<Component>,
},
}Expand description
A node in a Doc’s component tree. Streaming output does not produce these
(it pushes directly to the renderer); only Doc and SectionBuilder do.
Variants§
Heading
KvBlock
Bullet
Status
Fields
§
label: Option<StatusLabel>Trailing styled label (e.g. [source-name]). Rendered at the END of
the subject by render_doc so the inner SGR reset can never be
followed by outer-role-styled text — enforces the at-end layout that
nested ANSI styling requires.
Hint
Note
Table
Fields
Section
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Component
impl RefUnwindSafe for Component
impl Send for Component
impl Sync for Component
impl Unpin for Component
impl UnsafeUnpin for Component
impl UnwindSafe for Component
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