Trait distill_importer::Importer[][src]

pub trait Importer: Send + 'static {
    type Options: Send + Sync + 'static;
    type State: Serialize + Send + 'static;
    fn version_static() -> u32
    where
        Self: Sized
;
fn version(&self) -> u32;
fn import(
        &self,
        op: &mut ImportOp,
        source: &mut dyn Read,
        options: &Self::Options,
        state: &mut Self::State
    ) -> Result<ImporterValue>; fn export(
        &self,
        _output: &mut dyn Write,
        _options: &Self::Options,
        _state: &mut Self::State,
        _assets: Vec<ExportAsset>
    ) -> Result<ImporterValue> { ... } }

Importers parse file formats and produce assets.

Associated Types

type Options: Send + Sync + 'static[src]

Options can store settings that change importer behaviour. Will be automatically stored in .meta files and passed to Importer::import.

type State: Serialize + Send + 'static[src]

State is maintained by the asset pipeline to enable Importers to store state between calls to import(). This is primarily used to ensure IDs are stable between imports by storing generated AssetUuids with mappings to format-internal identifiers.

Loading content...

Required methods

fn version_static() -> u32 where
    Self: Sized
[src]

Returns the version of the importer. This version should change any time the importer behaviour changes to trigger reimport of assets.

fn version(&self) -> u32[src]

Returns the version of the importer. This version should change any time the importer behaviour changes to trigger reimport of assets.

fn import(
    &self,
    op: &mut ImportOp,
    source: &mut dyn Read,
    options: &Self::Options,
    state: &mut Self::State
) -> Result<ImporterValue>
[src]

Reads the given bytes and produces assets.

Loading content...

Provided methods

fn export(
    &self,
    _output: &mut dyn Write,
    _options: &Self::Options,
    _state: &mut Self::State,
    _assets: Vec<ExportAsset>
) -> Result<ImporterValue>
[src]

Writes a set of assets to a source file format that can be read by import.

Loading content...

Implementors

Loading content...