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()
.
The sections in this book.
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.
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.
Append a BookItem
to the Book
.
Formats the value using the given formatter. Read more
Performs copy-assignment from source
. Read more
Returns the "default value" for a type. Read more
This method tests for self
and other
values to be equal, and is used by ==
. Read more
This method tests for !=
.