use crate::admin::domain::*; use async_trait::async_trait; use serde_json::Value; struct Repository {} impl Repository {} #[async_trait] impl AdminRepository for Repository { async fn info(&self, _: &RepositoryContext) -> RepositoryInfo { RepoInfo { name: "My Empty Repository", lookup_key: "id", display_list: &["id"], fields: &[], } .into() } // GET on item collection. async fn list(&self, model: &RepositoryContext) -> RepositoryList { RepositoryList::Empty } // POST on item collection. async fn create( &mut self, model: &RepositoryContext, mut data: Value, ) -> Option { None } // GET single item. async fn get(&self, model: &RepositoryContext, id: LookupKey) -> Option { None } // PATCH single item. async fn update( &mut self, model: &RepositoryContext, id: LookupKey, data: Value, ) -> Option { None } // PUT single item. async fn replace( &mut self, model: &RepositoryContext, id: LookupKey, data: Value, ) -> Option { None } // DELETE single item. async fn delete(&mut self, _: &RepositoryContext, id: LookupKey) -> Option { None } }