storage::store

Trait MazeStore

Source
pub trait MazeStore {
    // Required methods
    fn create_maze(
        &mut self,
        owner: &User,
        maze: &mut Maze,
    ) -> Result<(), Error>;
    fn delete_maze(&mut self, owner: &User, id: &str) -> Result<(), Error>;
    fn update_maze(
        &mut self,
        owner: &User,
        maze: &mut Maze,
    ) -> Result<(), Error>;
    fn get_maze(&self, owner: &User, id: &str) -> Result<Maze, Error>;
    fn find_maze_by_name(
        &self,
        owner: &User,
        name: &str,
    ) -> Result<MazeItem, Error>;
    fn get_maze_items(
        &self,
        owner: &User,
        include_definitions: bool,
    ) -> Result<Vec<MazeItem>, Error>;
}
Expand description

Represents a store for holding mazes and related objects

Required Methods§

Source

fn create_maze(&mut self, owner: &User, maze: &mut Maze) -> Result<(), Error>

Adds a new maze to the store and sets the allocated id within the maze object

Source

fn delete_maze(&mut self, owner: &User, id: &str) -> Result<(), Error>

Deletes a maze from the store

Source

fn update_maze(&mut self, owner: &User, maze: &mut Maze) -> Result<(), Error>

Updates a maze within the store

Source

fn get_maze(&self, owner: &User, id: &str) -> Result<Maze, Error>

Loads a maze from the store

Source

fn find_maze_by_name(&self, owner: &User, name: &str) -> Result<MazeItem, Error>

Locates a maze item by its name within the store

Source

fn get_maze_items( &self, owner: &User, include_definitions: bool, ) -> Result<Vec<MazeItem>, Error>

Returns the list of maze items within the store, sorted alphabetically in ascending order

Implementors§