use std::any::Any; use anyhow::Error; use serde_json::Value; use crate::{ObjectMeta, SettingMeta}; #[async_trait::async_trait] pub trait MetadataProvider: Send + Sync + 'static { fn provides_for(&self, object: &dyn Any) -> bool; async fn write( &self, object: &(dyn Any + Send + Sync), object_meta: &ObjectMeta, setting: &(dyn Any + Send + Sync), setting_meta: &SettingMeta, ) -> Result<(), Error>; async fn read( &self, object: &(dyn Any + Send + Sync), object_meta: &ObjectMeta, setting_meta: &SettingMeta, ) -> Result; }