pub struct Repository {
pub description: RootDescription,
/* private fields */
}Expand description
Definition of a brevdash data repository.
Fields§
§description: RootDescriptionThe root description string.
Implementations§
Source§impl Repository
impl Repository
Sourcepub fn create<P: AsRef<Path>>(
path: P,
description: RootDescription,
) -> Result<Self>
pub fn create<P: AsRef<Path>>( path: P, description: RootDescription, ) -> Result<Self>
Create a repository at a directory path.
The directory must already exist and be writable.
Sourcepub fn store_description(&self) -> Result<()>
pub fn store_description(&self) -> Result<()>
Store the description file inside the repository.
Sourcepub fn project_datapoint_artifacts_directory_path(
&self,
project_id: &str,
date: NaiveDate,
) -> PathBuf
pub fn project_datapoint_artifacts_directory_path( &self, project_id: &str, date: NaiveDate, ) -> PathBuf
Get the path for the artifacts of a project at a specific date.
Sourcepub fn project_datapoint_characteristic_artifacts_directory_path(
&self,
project_id: &str,
date: NaiveDate,
characteristic_id: &str,
) -> PathBuf
pub fn project_datapoint_characteristic_artifacts_directory_path( &self, project_id: &str, date: NaiveDate, characteristic_id: &str, ) -> PathBuf
Get the path for the artifacts of a characteristic at a specific date.
Sourcepub fn project_datapoint_characteristic_artifact_path(
&self,
project_id: &str,
date: NaiveDate,
characteristic_id: &str,
artifact_relative_path: &Path,
) -> PathBuf
pub fn project_datapoint_characteristic_artifact_path( &self, project_id: &str, date: NaiveDate, characteristic_id: &str, artifact_relative_path: &Path, ) -> PathBuf
Get the path for an artifact.
Sourcepub fn load_project_ids(&self) -> Result<Vec<String>>
pub fn load_project_ids(&self) -> Result<Vec<String>>
Load the list of project ids inside the repository.
Sourcepub fn has_project(&self, project_id: &str) -> bool
pub fn has_project(&self, project_id: &str) -> bool
Query whether the repository contains a project with a specific id.
Sourcepub fn store_project_description(
&self,
project_id: &str,
description: &ProjectDescription,
) -> Result<()>
pub fn store_project_description( &self, project_id: &str, description: &ProjectDescription, ) -> Result<()>
Store the description of a project.
Sourcepub fn load_project_description(
&self,
project_id: &str,
) -> Result<ProjectDescription>
pub fn load_project_description( &self, project_id: &str, ) -> Result<ProjectDescription>
Load the description of a project by id.
Sourcepub fn load_project_descriptions(
&self,
) -> Result<BTreeMap<String, ProjectDescription>>
pub fn load_project_descriptions( &self, ) -> Result<BTreeMap<String, ProjectDescription>>
Load the descriptions for all projects.
Sourcepub fn project_has_datapoint_date(
&self,
project_id: &str,
date: NaiveDate,
) -> bool
pub fn project_has_datapoint_date( &self, project_id: &str, date: NaiveDate, ) -> bool
Query whether the repository contains a datapoint at a specific date.
Sourcepub fn load_project_datapoint_dates(
&self,
project_id: &str,
) -> Result<Vec<NaiveDate>>
pub fn load_project_datapoint_dates( &self, project_id: &str, ) -> Result<Vec<NaiveDate>>
Load a list of all datapoint dates for a specific project id.
Sourcepub fn store_project_datapoint(
&self,
project_id: &str,
date: NaiveDate,
datapoint: &DataPoint,
) -> Result<()>
pub fn store_project_datapoint( &self, project_id: &str, date: NaiveDate, datapoint: &DataPoint, ) -> Result<()>
Store a datapoint at a specific date.