use crate::Error;
use alloc::{boxed::Box, vec::Vec};
use async_trait::async_trait;
#[async_trait(?Send)]
pub trait GltfResourceLoader {
type Error: Into<Box<Error>>;
type ImageData;
fn set_path(&mut self, _path: &str) {}
async fn get_gltf(&self, uri: &str) -> Result<Vec<u8>, Self::Error>;
async fn get_buffer(&self, uri: &str) -> Result<Vec<u8>, Self::Error>;
async fn get_image(&self, uri: &str) -> Result<Self::ImageData, Self::Error>;
async fn decode_image(
&self,
image: &[u8],
mime_type: &str,
) -> Result<Self::ImageData, Self::Error>;
}