#[non_exhaustive]pub struct BookConfig {
pub title: Option<String>,
pub authors: Vec<String>,
pub description: Option<String>,
pub src: PathBuf,
pub language: Option<String>,
pub text_direction: Option<TextDirection>,
}Expand description
Configuration options which are specific to the book and required for loading it from disk.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.title: Option<String>The book’s title.
The book’s authors.
description: Option<String>An optional description for the book.
src: PathBufLocation of the book source relative to the book’s root directory.
language: Option<String>The main language of the book.
text_direction: Option<TextDirection>The direction of text in the book: Left-to-right (LTR) or Right-to-left (RTL).
When not specified, the text direction is derived from BookConfig::language.
Implementations§
Source§impl BookConfig
impl BookConfig
Sourcepub fn realized_text_direction(&self) -> TextDirection
pub fn realized_text_direction(&self) -> TextDirection
Gets the realized text direction, either from BookConfig::text_direction
or derived from BookConfig::language, to be used by templating engines.
Trait Implementations§
Source§impl Clone for BookConfig
impl Clone for BookConfig
Source§fn clone(&self) -> BookConfig
fn clone(&self) -> BookConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BookConfig
impl Debug for BookConfig
Source§impl Default for BookConfig
impl Default for BookConfig
Source§fn default() -> BookConfig
fn default() -> BookConfig
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BookConfigwhere
BookConfig: Default,
impl<'de> Deserialize<'de> for BookConfigwhere
BookConfig: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<BookConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<BookConfig, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for BookConfig
impl PartialEq for BookConfig
Source§impl Serialize for BookConfig
impl Serialize for BookConfig
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for BookConfig
Auto Trait Implementations§
impl Freeze for BookConfig
impl RefUnwindSafe for BookConfig
impl Send for BookConfig
impl Sync for BookConfig
impl Unpin for BookConfig
impl UnwindSafe for BookConfig
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