pub enum ContentNode {
Text(StyledText),
Table(ContentTable),
Code {
language: Option<String>,
source: String,
},
Chart(ChartSpec),
KeyValue(Vec<(String, ContentNode)>),
Fragment(Vec<ContentNode>),
}Expand description
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 with_italic(self) -> Self
pub fn with_italic(self) -> Self
Apply italic.
Sourcepub fn with_underline(self) -> Self
pub fn with_underline(self) -> Self
Apply underline.
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<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::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
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