pub trait GltfResourceLoader {
    type Error: Into<Box<Error>>;
    type ImageData;

    fn get_gltf<'life0, 'life1, 'async_trait>(
        &'life0 self,
        uri: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Self::Error>> + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn get_buffer<'life0, 'life1, 'async_trait>(
        &'life0 self,
        uri: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<Vec<u8>, Self::Error>> + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn get_image<'life0, 'life1, 'async_trait>(
        &'life0 self,
        uri: &'life1 str
    ) -> Pin<Box<dyn Future<Output = Result<Self::ImageData, Self::Error>> + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        Self: 'async_trait
; fn decode_image<'life0, 'life1, 'life2, 'async_trait>(
        &'life0 self,
        image: &'life1 [u8],
        mime_type: &'life2 str
    ) -> Pin<Box<dyn Future<Output = Result<Self::ImageData, Self::Error>> + 'async_trait>>
    where
        'life0: 'async_trait,
        'life1: 'async_trait,
        'life2: 'async_trait,
        Self: 'async_trait
; fn set_path(&mut self, _path: &str) { ... } }
Expand description

Loader of glTF resources.

Required Associated Types

Loading error type.

Image data type.

Required Methods

Loads a glTF JSON or GLB file from path into bytes.

Loads a binary buffer from path or data url.

Loads an image from path or data url.

Decodes an image file binary of given mime type as image data.

Provided Methods

Sets the root path of the asset.

Implementors