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§
Sourcefn save(&self, item: &BacklogItem) -> impl Future<Output = Result<()>>
fn save(&self, item: &BacklogItem) -> impl Future<Output = Result<()>>
Save a backlog item, replacing any existing item with the same ID.
Sourcefn load(&self, id: &ItemId) -> impl Future<Output = Result<BacklogItem>>
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.
Sourcefn list(&self) -> impl Future<Output = Result<Vec<BacklogItem>>>
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).
Sourcefn delete(&self, id: &ItemId) -> impl Future<Output = Result<()>>
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.
Sourcefn archive(&self, id: &ItemId) -> impl Future<Output = Result<PathBuf>>
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".