Struct mdbook::book::Book[][src]

pub struct Book {
    pub sections: Vec<BookItem>,
    // some fields omitted
}

A dumb tree structure representing a book.

For the moment a book is just a collection of BookItems which are accessible by either iterating (immutably) over the book with iter(), or recursively applying a closure to each section to mutate the chapters, using for_each_mut().

Fields

The sections in this book.

Methods

impl Book
[src]

Create an empty book.

Important traits for BookItems<'a>

Get a depth-first iterator over the items in the book.

Recursively apply a closure to each item in the book, allowing you to mutate them.

Note

Unlike the iter() method, this requires a closure instead of returning an iterator. This is because using iterators can possibly allow you to have iterator invalidation errors.

Important traits for &'a mut R

Append a BookItem to the Book.

Trait Implementations

impl Debug for Book
[src]

Formats the value using the given formatter. Read more

impl Clone for Book
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Default for Book
[src]

Returns the "default value" for a type. Read more

impl PartialEq for Book
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

impl Send for Book

impl Sync for Book