Trait cuivre::resources::Loadable[][src]

pub trait Loadable where
    Self: Sized
{ type LoadOptions; type LoadError: Error + From<Error>; fn load_from_bytes(
        data: &[u8],
        options: Self::LoadOptions
    ) -> Result<Self, Self::LoadError>; fn load_from_file<P: AsRef<OsStr>>(
        path: P,
        options: Self::LoadOptions
    ) -> Result<Self, Self::LoadError> { ... } }

Represents a type that can be loaded from a file or byte sequence.

Associated Types

Type of an additional argument that can be supplied to the load methods.

Can use () if additional options are not needed.

Error type that can be by the load methods.

Use io::Error if loading from bytes cannot fail.

Required Methods

Loads the object from a byte sequence.

Provided Methods

Loads the object from a file.

Supplied path is relative to the game executable directory.

Implementors