diff --git a/src/styled.rs b/src/styled.rs index 2ee4efb..1a19540 100644 --- a/src/styled.rs +++ b/src/styled.rs @@ -15,6 +15,14 @@ impl Chunk { } } + pub fn string(&self) -> &str { + &self.string + } + + pub fn style(&self) -> ContentStyle { + self.style + } + pub fn plain(string: S) -> Self { Self::new(string, ContentStyle::default()) } @@ -81,6 +89,10 @@ impl Styled { self } + pub fn chunks(&self) -> &[Chunk] { + &self.0 + } + pub fn text(&self) -> String { self.0.iter().flat_map(|c| c.string.chars()).collect() }