use crate::models::client::*; use crate::models::car_station::*; use crate::models::car::*; use crate::models::rent::*; use async_trait::async_trait; #[async_trait] pub trait ClientRepository { async fn create(&self, client: BindingClient) -> Result; async fn read(&self, id: u32) -> Result; async fn read_all(&self) -> Result, String>; async fn update(&self, id: u32, client: BindingClient) -> Result; async fn delete(&self, id: u32) -> Result<(), String>; } #[async_trait] pub trait CarRepository { async fn create(&self, car: BindingCar) -> Result; async fn read(&self, id: u32) -> Result; async fn read_all(&self) -> Result, String>; async fn update(&self, id: u32, car: BindingCar) -> Result; async fn delete(&self, id: u32) -> Result<(), String>; } #[async_trait] pub trait CarStationRepository { async fn create(&self, car_station: BindingCarStation) -> Result; async fn read(&self, id: u32) -> Result; async fn read_all(&self) -> Result, String>; async fn update(&self, id: u32, car_station: BindingCarStation) -> Result; async fn delete(&self, id: u32) -> Result<(), String>; } #[async_trait] pub trait RentRepository { async fn create(&self, rent: BindingRent) -> Result; async fn read(&self, id: u32) -> Result; async fn read_all(&self) -> Result, String>; async fn update(&self, id: u32, rent: BindingRent) -> Result; async fn delete(&self, id: u32) -> Result<(), String>; } #[async_trait] pub trait OwnerRepository { async fn create(&self, client: BindingClient) -> Result; async fn read(&self, id: u32) -> Result; async fn read_all(&self) -> Result, String>; async fn update(&self, id: u32, client: BindingClient) -> Result; async fn delete(&self, id: u32) -> Result<(), String>; }