pub struct Config {
pub title: String,
pub description: Option<String>,
pub repo_url: Option<String>,
pub menu: Menu,
pub favicon: Option<String>,
pub header: NavDir,
pub footer: NavDir,
pub ui: UiOptions,
}Fields§
§title: String§description: Option<String>§repo_url: Option<String>§favicon: Option<String>§header: NavDir§ui: UiOptionsImplementations§
Source§impl Config
impl Config
Sourcepub fn at_root(path: &Path) -> DdResult<(Self, PathBuf)>
pub fn at_root(path: &Path) -> DdResult<(Self, PathBuf)>
Read the ddoc.hjson configuration file at the root of a ddoc project
Return both the config and the path where it was found
§Errors
Return DdError::ConfigNotFound if no ddoc.hjson is found at the specified path
or other DdError variants on read/parse errors
pub fn description(&self) -> Option<&str>
pub fn favicon(&self) -> Option<&str>
pub fn needs_search_script(&self) -> bool
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
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
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
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