test(lib_core): it saves and return tasks

refs: #5
This commit is contained in:
Alexander Navarro 2025-05-18 20:07:47 -04:00
parent 45a3bf291b
commit 94fe050c4a
8 changed files with 282 additions and 45 deletions

View file

@ -69,7 +69,7 @@ impl<T: TaskPayload> TasksPage<T> {
}
pub trait TaskStorage<T: TaskPayload> {
async fn insert_tasks(&self, tasks: Vec<Task<T>>) -> crate::Result<()>;
async fn insert_tasks<'a, I: IntoIterator<Item=&'a Task<T>>>(&self, tasks: I) -> crate::Result<()>;
fn get_tasks(&self, options: TaskStatus) -> impl Stream<Item = crate::Result<Task<T>>>;
async fn get_paginated_tasks(&self, page: &TaskPagination) -> crate::Result<TasksPage<T>>;