use crate::Resource;
pub mod in_memory;
pub trait DataLayer<R: Resource>: std::fmt::Debug + Send + Sync + 'static {
fn create(&self, resource: R) -> impl Future<Output = Result<R, crate::CreateError>> + Send;
fn read(
&self,
primary_key: &R::PrimaryKey,
) -> impl Future<Output = Result<R, crate::ReadError>> + Send;
fn update(&self, resource: R) -> impl Future<Output = Result<(), crate::UpdateError>> + Send;
fn destroy(
&self,
primary_key: &R::PrimaryKey,
) -> impl Future<Output = Result<R, crate::DestroyError>> + Send;
}