[][src]Trait libimagentrycategory::store::CategoryStore

pub trait CategoryStore {
    fn category_exists(&self, name: &str) -> Result<bool>;
fn create_category<'a>(&'a self, name: &str) -> Result<FileLockEntry<'a>>;
fn delete_category(&self, name: &str) -> Result<()>;
fn all_category_names(&self) -> Result<CategoryNameIter>;
fn get_category_by_name(&self, name: &str) -> Result<Option<FileLockEntry>>; }

Extension on the Store to make it a register for categories

The register writes files to the

Required methods

fn category_exists(&self, name: &str) -> Result<bool>

fn create_category<'a>(&'a self, name: &str) -> Result<FileLockEntry<'a>>

fn delete_category(&self, name: &str) -> Result<()>

fn all_category_names(&self) -> Result<CategoryNameIter>

fn get_category_by_name(&self, name: &str) -> Result<Option<FileLockEntry>>

Loading content...

Implementations on Foreign Types

impl CategoryStore for Store[src]

fn category_exists(&self, name: &str) -> Result<bool>[src]

Check whether a category exists

fn create_category<'a>(&'a self, name: &str) -> Result<FileLockEntry<'a>>[src]

Create a category

Fails if the category already exists (returns false then)

fn delete_category(&self, name: &str) -> Result<()>[src]

Delete a category

Automatically removes all category settings from entries which are linked to this category.

fn all_category_names(&self) -> Result<CategoryNameIter>[src]

Get all category names

fn get_category_by_name(&self, name: &str) -> Result<Option<FileLockEntry>>[src]

Get a category by its name

Returns the FileLockEntry which represents the category, so one can link to it and use it like a normal file in the store (which is exactly what it is).

Loading content...

Implementors

Loading content...