Skip to main content

TaskRepository

Trait TaskRepository 

Source
pub trait TaskRepository: Send + Sync {
    // Required methods
    async fn create(&self, task: &Task) -> Result<Task, RepositoryError>;
    async fn get(&self, id: Uuid) -> Result<Task, RepositoryError>;
    async fn list(&self, user_id: i32) -> Result<Vec<Task>, RepositoryError>;
    async fn update(&self, task: &Task) -> Result<Task, RepositoryError>;
    async fn delete(&self, id: Uuid) -> Result<(), RepositoryError>;
}

Required Methods§

Source

async fn create(&self, task: &Task) -> Result<Task, RepositoryError>

Source

async fn get(&self, id: Uuid) -> Result<Task, RepositoryError>

Source

async fn list(&self, user_id: i32) -> Result<Vec<Task>, RepositoryError>

Source

async fn update(&self, task: &Task) -> Result<Task, RepositoryError>

Source

async fn delete(&self, id: Uuid) -> Result<(), RepositoryError>

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§