[][src]Trait keeshond_datapack::DataObject

pub trait DataObject {
    fn folder_name() -> &'static str
    where
        Self: Sized
;
fn want_file(pathname: &str) -> bool
    where
        Self: Sized
;
fn from_io(
        reader: &mut dyn Read,
        full_pathname: &str,
        source: &mut Box<dyn Source>
    ) -> Result<Self, DataError>
    where
        Self: Sized
; }

Represents a data item loaded from a package. Implement this trait to allow the system to load new types of data.

Required methods

fn folder_name() -> &'static str where
    Self: Sized

The folder name that DataObjects of this type are stored in

fn want_file(pathname: &str) -> bool where
    Self: Sized

Determines whether or not a given file should be loaded while iterating through a package.

fn from_io(
    reader: &mut dyn Read,
    full_pathname: &str,
    source: &mut Box<dyn Source>
) -> Result<Self, DataError> where
    Self: Sized

A constructor that returns a new DataObject of this type given a Read object

Loading content...

Implementors

Loading content...