pub struct Book {
pub format_version: u32,
pub metadata: Metadata,
pub sections: Vec<Section>,
pub style: StyleSettings,
pub extra: Extra,
}Expand description
A whole book as imported and edited by the author.
Fields§
§format_version: u32§metadata: Metadata§sections: Vec<Section>Front matter, body and back matter in reading order.
style: StyleSettings§extra: ExtraImplementations§
Source§impl Book
impl Book
pub fn new(metadata: Metadata) -> Self
Sourcepub fn chapters(&self) -> impl Iterator<Item = &Section>
pub fn chapters(&self) -> impl Iterator<Item = &Section>
Body chapters only (what gets numbered).
Sourcepub fn section_numbers(&self) -> Vec<Option<SectionNumber>>
pub fn section_numbers(&self) -> Vec<Option<SectionNumber>>
The number of each section, by index: chapters and parts are
counted apart, Auto counts on from the last one of its kind,
Explicit(n) is n and the count goes on from it. Other kinds and
Numbering::None have none. Print, EPUB, pre-flight and the app all
number from this.
pub fn block(&self, at: BlockRef) -> Option<&Block>
pub fn block_mut(&mut self, at: BlockRef) -> Option<&mut Block>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Book
impl<'de> Deserialize<'de> for Book
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl StructuralPartialEq for Book
Auto Trait Implementations§
impl Freeze for Book
impl RefUnwindSafe for Book
impl Send for Book
impl Sync for Book
impl Unpin for Book
impl UnsafeUnpin for Book
impl UnwindSafe for Book
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more