use crate::error::Result;
use std::any::Any;
#[cfg_attr(feature = "async", async_trait::async_trait)]
pub trait StorageBackend: Send + Sync {
#[cfg(not(feature = "async"))]
fn store(&self, id: &str, data: &[u8]) -> Result<()>;
#[cfg(feature = "async")]
async fn store(&self, id: &str, data: &[u8]) -> Result<()>;
#[cfg(not(feature = "async"))]
fn retrieve(&self, id: &str) -> Result<Vec<u8>>;
#[cfg(feature = "async")]
async fn retrieve(&self, id: &str) -> Result<Vec<u8>>;
#[cfg(not(feature = "async"))]
fn list(&self) -> Result<Vec<String>>;
#[cfg(feature = "async")]
async fn list(&self) -> Result<Vec<String>>;
#[cfg(not(feature = "async"))]
fn delete(&self, id: &str) -> Result<()>;
#[cfg(feature = "async")]
async fn delete(&self, id: &str) -> Result<()>;
#[cfg(not(feature = "async"))]
fn exists(&self, id: &str) -> Result<bool>;
#[cfg(feature = "async")]
async fn exists(&self, id: &str) -> Result<bool>;
fn as_any(&self) -> &dyn Any;
}