Struct brevdash_data::Repository[][src]

pub struct Repository {
    pub description: RootDescription,
    // some fields omitted
}

Definition of a brevdash data repository.

Fields

description: RootDescription

The root description string.

Implementations

impl Repository[src]

pub fn open<P: AsRef<Path>>(path: P) -> Result<Self>[src]

Open a repository from a directory path.

pub fn create<P: AsRef<Path>>(
    path: P,
    description: RootDescription
) -> Result<Self>
[src]

Create a repository at a directory path.

The directory must already exist and be writable.

pub fn store_description(&self) -> Result<()>[src]

Store the description file inside the repository.

pub fn project_datapoint_characteristic_artifacts_directory_path(
    &self,
    project_id: &str,
    date: NaiveDate,
    characteristic_id: &str
) -> PathBuf
[src]

Get the path for the artifacts of a characteristic at a specific date.

pub fn project_datapoint_characteristic_artifact_path(
    &self,
    project_id: &str,
    date: NaiveDate,
    characteristic_id: &str,
    artifact_relative_path: &Path
) -> PathBuf
[src]

Get the path for an artifact.

pub fn load_project_ids(&self) -> Result<Vec<String>>[src]

Load the list of project ids inside the repository.

pub fn has_project(&self, project_id: &str) -> bool[src]

Query whether the repository contains a project with a specific id.

pub fn store_project_description(
    &self,
    project_id: &str,
    description: &ProjectDescription
) -> Result<()>
[src]

Store the description of a project.

pub fn load_project_description(
    &self,
    project_id: &str
) -> Result<ProjectDescription>
[src]

Load the description of a project by id.

pub fn load_project_descriptions(
    &self
) -> Result<BTreeMap<String, ProjectDescription>>
[src]

Load the descriptions for all projects.

pub fn project_has_datapoint_date(
    &self,
    project_id: &str,
    date: NaiveDate
) -> bool
[src]

Query whether the repository contains a datapoint at a specific date.

pub fn load_project_datapoint_dates(
    &self,
    project_id: &str
) -> Result<Vec<NaiveDate>>
[src]

Load a list of all datapoint dates for a specific project id.

pub fn store_project_datapoint(
    &self,
    project_id: &str,
    date: NaiveDate,
    datapoint: &DataPoint
) -> Result<()>
[src]

Store a datapoint at a specific date.

pub fn load_project_datapoint(
    &self,
    project_id: &str,
    date: NaiveDate
) -> Result<DataPoint>
[src]

Load a datapoint at a specific date.

pub fn load_project_datapoints(
    &self,
    project_id: &str
) -> Result<BTreeMap<NaiveDate, DataPoint>>
[src]

Load all datapoints for a project id.

Trait Implementations

impl Debug for Repository[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.