pub struct ContentBlock {
pub content_type: ContentType,
pub text: String,
pub level: u8,
}Expand description
A block of content extracted from the page
Fields§
§content_type: ContentTypeType of content
text: StringText content
level: u8Nesting level (for lists)
Implementations§
Source§impl ContentBlock
impl ContentBlock
Sourcepub fn new(content_type: ContentType, text: &str) -> Self
pub fn new(content_type: ContentType, text: &str) -> Self
Create a new content block
Sourcepub fn with_level(self, level: u8) -> Self
pub fn with_level(self, level: u8) -> Self
Create with level
Sourcepub fn is_heading(&self) -> bool
pub fn is_heading(&self) -> bool
Check if this is a heading
Sourcepub fn heading_level(&self) -> Option<u8>
pub fn heading_level(&self) -> Option<u8>
Get heading level (1 for title, 2-6 for headings)
Trait Implementations§
Source§impl Clone for ContentBlock
impl Clone for ContentBlock
Source§fn clone(&self) -> ContentBlock
fn clone(&self) -> ContentBlock
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 moreAuto Trait Implementations§
impl Freeze for ContentBlock
impl RefUnwindSafe for ContentBlock
impl Send for ContentBlock
impl Sync for ContentBlock
impl Unpin for ContentBlock
impl UnwindSafe for ContentBlock
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