Struct mdbook::book::Book [−][src]
Expand description
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 (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.sections: Vec<BookItem>
The sections in this book.
Implementations
impl Book
[src]
impl Book
[src]pub fn for_each_mut<F>(&mut self, func: F) where
F: FnMut(&mut BookItem),
[src]
pub fn for_each_mut<F>(&mut self, func: F) where
F: FnMut(&mut BookItem),
[src]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.
Trait Implementations
impl<'de> Deserialize<'de> for Book
[src]
impl<'de> Deserialize<'de> for Book
[src]fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Book
[src]
Auto Trait Implementations
impl RefUnwindSafe for Book
impl Send for Book
impl Sync for Book
impl Unpin for Book
impl UnwindSafe for Book
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]pub fn borrow_mut(&mut self) -> &mut T
[src]
pub fn borrow_mut(&mut self) -> &mut T
[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone,
[src]
impl<T> ToOwned for T where
T: Clone,
[src]type Owned = T
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn to_owned(&self) -> T
[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)
[src]
pub fn clone_into(&self, target: &mut T)
[src]🔬 This is a nightly-only experimental API. (toowned_clone_into
)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,