Struct mdbook::book::Book
[−]
[src]
pub struct Book { /* 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()
.
Methods
impl Book
[src]
fn new() -> Self
[src]
Create an empty book.
fn iter(&self) -> BookItems
[src]
Get a depth-first iterator over the items in the book.
fn for_each_mut<F>(&mut self, func: F) where
F: FnMut(&mut BookItem),
[src]
F: FnMut(&mut BookItem),
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.
fn push_item<I: Into<BookItem>>(&mut self, item: I) -> &mut Self
[src]
Append a BookItem
to the Book
.
Trait Implementations
impl Debug for Book
[src]
impl Clone for Book
[src]
fn clone(&self) -> Book
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more