[][src]Struct markdown_extract::document::Section

pub struct Section {
    pub level: u8,
    pub title: String,
    pub body: String,
    pub parent: Option<usize>,
    pub children: Vec<usize>,
}

A section within a markdown document

Fields

level: u8

Section depth. In markdown, legal values range from 1 to 6, although this implementation technically allows more.

title: String

Title of section

body: String

Raw markdown body. Does not include any child sections. See the children property for child content.

parent: Option<usize>

An optional pointer to a parent section. This property should always be Some, unless the section is located at the root of the document.

children: Vec<usize>

A vector of child sections

Methods

impl Section[src]

pub fn new() -> Section[src]

Construct a new section

pub fn append_to_body(&mut self, line: String)[src]

Appends the given line to the section's body

pub fn add_child(&mut self, child: usize)[src]

Add a child to this section.

Trait Implementations

impl Clone for Section[src]

impl Debug for Section[src]

Auto Trait Implementations

impl RefUnwindSafe for Section

impl Send for Section

impl Sync for Section

impl Unpin for Section

impl UnwindSafe for Section

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.