pub trait Ligature {
    fn all_datasets(
        &self
    ) -> Box<dyn Iterator<Item = Result<Dataset, LigatureError>>>;
fn dataset_exists(&self, dataset: &Dataset) -> Result<bool, LigatureError>;
fn match_datasets_prefix(
        &self,
        prefix: &str
    ) -> Box<dyn Iterator<Item = Result<Dataset, LigatureError>>>;
fn match_datasets_range(
        &self,
        start: &str,
        end: &str
    ) -> Box<dyn Iterator<Item = Result<Dataset, LigatureError>>>;
fn create_dataset(&self, dataset: &Dataset) -> Result<(), LigatureError>;
fn delete_dataset(&self, dataset: &Dataset) -> Result<(), LigatureError>;
fn query<T>(
        &self,
        dataset: &Dataset,
        f: QueryFn<T>
    ) -> Result<T, LigatureError>;
fn write<T>(
        &self,
        dataset: &Dataset,
        f: WriteFn<T>
    ) -> Result<T, LigatureError>; }
Expand description

A trait that all Ligature implementations implement.

Required methods

Returns all Datasets in a Ligature instance.

Check if a given Dataset exists.

Returns all Datasets in a Ligature instance that start with the given prefix.

Returns all Datasets in a Ligature instance that are in a given range (inclusive, exclusive].

Creates a dataset with the given name. TODO should probably return its own error type { InvalidDataset, DatasetExists, CouldNotCreateDataset }

Deletes a dataset with the given name. TODO should probably return its own error type { InvalidDataset, CouldNotDeleteDataset }

Initializes a QueryTx TODO should probably return its own error type CouldNotInitializeQueryTx

Initializes a WriteTx TODO should probably return its own error type CouldNotInitializeWriteTx

Implementors