Skip to main content

BacklogItemRepository

Trait BacklogItemRepository 

Source
pub trait BacklogItemRepository {
    // Required methods
    fn save(&self, item: &BacklogItem) -> impl Future<Output = Result<()>>;
    fn load(&self, id: &ItemId) -> impl Future<Output = Result<BacklogItem>>;
    fn list(&self) -> impl Future<Output = Result<Vec<BacklogItem>>>;
    fn delete(&self, id: &ItemId) -> impl Future<Output = Result<()>>;
    fn archive(&self, id: &ItemId) -> impl Future<Output = Result<PathBuf>>;
    fn next_id(&self, prefix: &str) -> impl Future<Output = Result<ItemId>>;
}

Required Methods§

Source

fn save(&self, item: &BacklogItem) -> impl Future<Output = Result<()>>

Save a backlog item, replacing any existing item with the same ID.

Source

fn load(&self, id: &ItemId) -> impl Future<Output = Result<BacklogItem>>

Load a backlog item by ID. Return crate::error::Error::NotFound when it does not exist.

Source

fn list(&self) -> impl Future<Output = Result<Vec<BacklogItem>>>

Return all backlog items in lexicographic rank order, using the ID as a tie-breaker.

Implementations may read files concurrently and parse them in parallel (see docs/DESIGN.md §3.4).

Source

fn delete(&self, id: &ItemId) -> impl Future<Output = Result<()>>

Delete a backlog item by ID. Return crate::error::Error::NotFound when it does not exist.

Source

fn archive(&self, id: &ItemId) -> impl Future<Output = Result<PathBuf>>

Move a backlog item by ID to archive/ and return the destination path.

This is the non-destructive alternative to Self::delete. Return crate::error::Error::NotFound when the item does not exist.

Source

fn next_id(&self, prefix: &str) -> impl Future<Output = Result<ItemId>>

Return the next never-issued ID for prefix: one greater than the maximum issued or existing number, or 1 when no such ID exists.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§