pub enum ContentNode {
Text(StyledText),
Table(ContentTable),
Code {
language: Option<String>,
source: String,
},
Chart(ChartSpec),
KeyValue(Vec<(String, ContentNode)>),
Fragment(Vec<ContentNode>),
}Expand description
Re-export content types used in WireValue::Content.
A structured content node — the output of Content.render()
Variants§
Text(StyledText)
Styled text with spans
Table(ContentTable)
Table with headers, rows, and optional styling
Code
Code block with optional language
Chart(ChartSpec)
Chart specification
KeyValue(Vec<(String, ContentNode)>)
Key-value pairs
Fragment(Vec<ContentNode>)
Composition of multiple content nodes
Implementations§
Source§impl ContentNode
impl ContentNode
Sourcepub fn plain(text: impl Into<String>) -> ContentNode
pub fn plain(text: impl Into<String>) -> ContentNode
Create a plain text node.
Sourcepub fn with_fg(self, color: Color) -> ContentNode
pub fn with_fg(self, color: Color) -> ContentNode
Apply foreground color to this node.
Sourcepub fn with_bg(self, color: Color) -> ContentNode
pub fn with_bg(self, color: Color) -> ContentNode
Apply background color.
Sourcepub fn with_bold(self) -> ContentNode
pub fn with_bold(self) -> ContentNode
Apply bold.
Sourcepub fn with_italic(self) -> ContentNode
pub fn with_italic(self) -> ContentNode
Apply italic.
Sourcepub fn with_underline(self) -> ContentNode
pub fn with_underline(self) -> ContentNode
Apply underline.
Sourcepub fn with_dim(self) -> ContentNode
pub fn with_dim(self) -> ContentNode
Apply dim.
Trait Implementations§
Source§impl Clone for ContentNode
impl Clone for ContentNode
Source§fn clone(&self) -> ContentNode
fn clone(&self) -> ContentNode
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ContentNode
impl Debug for ContentNode
Source§impl<'de> Deserialize<'de> for ContentNode
impl<'de> Deserialize<'de> for ContentNode
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContentNode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ContentNode, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Display for ContentNode
impl Display for ContentNode
Source§impl PartialEq for ContentNode
impl PartialEq for ContentNode
Source§impl Serialize for ContentNode
impl Serialize for ContentNode
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ContentNode
Auto Trait Implementations§
impl Freeze for ContentNode
impl RefUnwindSafe for ContentNode
impl Send for ContentNode
impl Sync for ContentNode
impl Unpin for ContentNode
impl UnsafeUnpin for ContentNode
impl UnwindSafe for ContentNode
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