Trait asciii::storage::storable::Storable
[−]
[src]
pub trait Storable: Send + Sync { fn open_folder(_: &FolderPath) -> StorageResult<Self>
where
Self: Sized; fn open_file(_: &FilePath) -> StorageResult<Self>
where
Self: Sized; fn from_template(
project_name: &str,
template: &Path,
data: &HashMap<&str, String>
) -> StorageResult<Self>
where
Self: Sized; fn short_desc(&self) -> String; fn modified_date(&self) -> Option<Date<Utc>>; fn index(&self) -> Option<String>; fn prefix(&self) -> Option<String>; fn set_file(&mut self, new_file: &Path); fn file(&self) -> FilePathBuf; fn matches_filter(&self, key: &str, val: &str) -> bool; fn matches_search(&self, term: &str) -> bool; fn is_ready_for_archive(&self) -> bool; fn ident(&self) -> String { ... } fn year(&self) -> Option<i32> { ... } fn delete_project_dir_if<F>(&self, confirmed: F) -> Result<()>
where
F: Fn() -> bool, { ... } fn set_git_status(&mut self, GitStatus) { ... } fn get_git_status(&self) -> GitStatus { ... } fn file_extension() -> String { ... } fn file_name(&self) -> String { ... } fn dir(&self) -> FolderPathBuf { ... } }
Required Methods
fn open_folder(_: &FolderPath) -> StorageResult<Self> where
Self: Sized,
Self: Sized,
opens a projectfolder
fn open_file(_: &FilePath) -> StorageResult<Self> where
Self: Sized,
Self: Sized,
fn from_template(
project_name: &str,
template: &Path,
data: &HashMap<&str, String>
) -> StorageResult<Self> where
Self: Sized,
project_name: &str,
template: &Path,
data: &HashMap<&str, String>
) -> StorageResult<Self> where
Self: Sized,
creates in tempfile
fn short_desc(&self) -> String
fn modified_date(&self) -> Option<Date<Utc>>
fn index(&self) -> Option<String>
For sorting
fn prefix(&self) -> Option<String>
For archiving
fn set_file(&mut self, new_file: &Path)
Sets the project File
fn file(&self) -> FilePathBuf
Path to project file
fn matches_filter(&self, key: &str, val: &str) -> bool
fn matches_search(&self, term: &str) -> bool
fn is_ready_for_archive(&self) -> bool
Provided Methods
fn ident(&self) -> String
For file names
fn year(&self) -> Option<i32>
fn delete_project_dir_if<F>(&self, confirmed: F) -> Result<()> where
F: Fn() -> bool,
F: Fn() -> bool,
Deletes the project if the passed in closure returns true
fn set_git_status(&mut self, GitStatus)
Tell a project its own git status after opening
This depoends on the feature git_statuses
fn get_git_status(&self) -> GitStatus
Ask a project for its gitstatus
This depoends on the feature git_statuses
fn file_extension() -> String
Main Projectfile extension
fn file_name(&self) -> String
Filename as fallback
fn dir(&self) -> FolderPathBuf
Path to project folder
Implementors
impl Storable for Project