Struct tpnote_lib::config::LibCfg  
source · pub struct LibCfg {
    pub scheme_sync_default: String,
    pub scheme: Vec<Scheme>,
    pub tmpl_html: TmplHtml,
}Expand description
Configuration data, deserialized from the configuration file.
Fields§
§scheme_sync_default: StringThe fallback scheme for the sync_filename template choice, if the
scheme header variable is empty or is not defined.
scheme: Vec<Scheme>Configuration of Scheme.
tmpl_html: TmplHtmlConfiguration of HTML templates.
Implementations§
source§impl LibCfg
 
impl LibCfg
sourcepub fn scheme_idx(&self, name: &str) -> Result<usize, LibCfgError>
 
pub fn scheme_idx(&self, name: &str) -> Result<usize, LibCfgError>
Returns the index of a named scheme. If no scheme with that name can be
be found, return LibCfgError::SchemeNotFound.
source§impl LibCfg
 
impl LibCfg
sourcepub fn assert_validity(&self) -> Result<(), LibCfgError>
 
pub fn assert_validity(&self) -> Result<(), LibCfgError>
Perform some semantic consistency checks.
- sort_tag.extra_separatormust NOT be in- sort_tag.extra_chars.
- sort_tag.extra_separatormust NOT be in- 0..9.
- sort_tag.extra_separatormust NOT be in- a..z.
- sort_tag.extra_separatormust NOT be in- sort_tag.extra_chars.
- sort_tag.extra_separatormust NOT- FILENAME_DOTFILE_MARKER.
- copy_counter.extra_separatormust be one of- sanitize_filename_reader_friendly::TRIM_LINE_CHARS.
- All characters of sort_tag.separatormust be insort_tag.extra_chars.
- sort_tag.separatormust start with NOT- FILENAME_DOTFILE_MARKER.
Trait Implementations§
source§impl<'de> Deserialize<'de> for LibCfg
 
impl<'de> Deserialize<'de> for LibCfg
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 LibCfg
impl RefUnwindSafe for LibCfg
impl Send for LibCfg
impl Sync for LibCfg
impl Unpin for LibCfg
impl UnwindSafe for LibCfg
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