pub struct Vault {
pub config: VaultConfig,
pub date_handler: DateTimeHandler,
}Fields§
§config: VaultConfig§date_handler: DateTimeHandlerImplementations§
Source§impl Vault
impl Vault
pub fn new(config: VaultConfig) -> Self
Sourcepub fn get_table_headers(&self) -> (String, String)
pub fn get_table_headers(&self) -> (String, String)
Get locale-dependent table headers
pub fn get_note_path(&self, date: NaiveDate) -> PathBuf
Sourcepub fn add_note(
&self,
content: &str,
timestamp: Option<DateTime<Local>>,
) -> Result<(), JourneyError>
pub fn add_note( &self, content: &str, timestamp: Option<DateTime<Local>>, ) -> Result<(), JourneyError>
Backwards-compatible API: add a note without category
Sourcepub fn add_note_with_category(
&self,
content: &str,
timestamp: Option<DateTime<Local>>,
category: Option<&str>,
) -> Result<(), JourneyError>
pub fn add_note_with_category( &self, content: &str, timestamp: Option<DateTime<Local>>, category: Option<&str>, ) -> Result<(), JourneyError>
Category-aware API used by the application
pub fn find_section(&self, content: &str, section_name: &str) -> Option<usize>
pub fn find_section_end(&self, lines: &[&str], section_start: usize) -> usize
pub fn find_section_content_end( &self, lines: &[&str], section_start: usize, ) -> usize
Sourcepub fn list_notes(&self, date: NaiveDate) -> Result<Vec<String>, JourneyError>
pub fn list_notes(&self, date: NaiveDate) -> Result<Vec<String>, JourneyError>
Backwards-compatible API: list notes without category
Sourcepub fn list_notes_with_category(
&self,
date: NaiveDate,
category: Option<&str>,
) -> Result<Vec<String>, JourneyError>
pub fn list_notes_with_category( &self, date: NaiveDate, category: Option<&str>, ) -> Result<Vec<String>, JourneyError>
Category-aware API used by the application
pub fn get_editor_path(&self, date: NaiveDate) -> PathBuf
Sourcepub fn detect_note_format(&self, content: &str) -> Option<NoteFormat>
pub fn detect_note_format(&self, content: &str) -> Option<NoteFormat>
Detect the current note format in the content
Auto Trait Implementations§
impl Freeze for Vault
impl RefUnwindSafe for Vault
impl Send for Vault
impl Sync for Vault
impl Unpin for Vault
impl UnsafeUnpin for Vault
impl UnwindSafe for Vault
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