pub struct BookConfig {
pub title: Option<String>,
pub authors: Vec<String>,
pub description: Option<String>,
pub src: PathBuf,
pub multilingual: bool,
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§
§title: Option<String>
The book’s title.
The book’s authors.
description: Option<String>
An optional description for the book.
src: PathBuf
Location of the book source relative to the book’s root directory.
multilingual: bool
Does this book support more than one language?
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 copy 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<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
Source§impl PartialEq for BookConfig
impl PartialEq for BookConfig
Source§impl Serialize for BookConfig
impl Serialize for BookConfig
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)