Struct mdbook::book::Chapter [−][src]
pub struct Chapter { pub name: String, pub content: String, pub number: Option<SectionNumber>, pub sub_items: Vec<BookItem>, pub path: PathBuf, pub parent_names: Vec<String>, }
The representation of a "chapter", usually mapping to a single file on disk however it may contain multiple sub-chapters.
Fields
name: String
The chapter's name.
content: String
The chapter's contents.
number: Option<SectionNumber>
The chapter's section number, if it has one.
sub_items: Vec<BookItem>
Nested items.
path: PathBuf
The chapter's location, relative to the SUMMARY.md
file.
parent_names: Vec<String>
An ordered list of the names of each chapter above this one, in the hierarchy.
Methods
impl Chapter
[src]
impl Chapter
pub fn new<P: Into<PathBuf>>(
name: &str,
content: String,
path: P,
parent_names: Vec<String>
) -> Chapter
[src]
pub fn new<P: Into<PathBuf>>(
name: &str,
content: String,
path: P,
parent_names: Vec<String>
) -> Chapter
Create a new chapter with the provided content.
Trait Implementations
impl From<Chapter> for BookItem
[src]
impl From<Chapter> for BookItem
impl Debug for Chapter
[src]
impl Debug for Chapter
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Chapter
[src]
impl Clone for Chapter
fn clone(&self) -> Chapter
[src]
fn clone(&self) -> Chapter
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl Default for Chapter
[src]
impl Default for Chapter
impl PartialEq for Chapter
[src]
impl PartialEq for Chapter
fn eq(&self, other: &Chapter) -> bool
[src]
fn eq(&self, other: &Chapter) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Chapter) -> bool
[src]
fn ne(&self, other: &Chapter) -> bool
This method tests for !=
.
impl Display for Chapter
[src]
impl Display for Chapter