[][src]Trait keeshond_datapack::DataObject

pub trait DataObject {
    pub fn folder_name() -> &'static str
    where
        Self: Sized
;
pub fn trust_policy() -> TrustPolicy;
pub fn want_file(pathname: &str) -> bool
    where
        Self: Sized
;
pub fn from_io(
        reader: Box<dyn ReadSeek>,
        full_pathname: &str,
        source: &mut Box<dyn Source>
    ) -> Result<Self, DataError>
    where
        Self: Sized
; pub fn write(
        &mut self,
        full_pathname: &str,
        source: &mut Box<dyn Source>
    ) -> Result<(), DataError> { ... }
pub fn generation(&self) -> u64 { ... }
pub fn set_generation(&mut self, generation: u64) { ... } }

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

Required methods

pub fn folder_name() -> &'static str where
    Self: Sized
[src]

The folder name that DataObjects of this type are stored in

pub fn trust_policy() -> TrustPolicy[src]

The TrustPolicy for this resource type, which determines what sources are allowed to load it.

pub fn want_file(pathname: &str) -> bool where
    Self: Sized
[src]

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

pub fn from_io(
    reader: Box<dyn ReadSeek>,
    full_pathname: &str,
    source: &mut Box<dyn Source>
) -> Result<Self, DataError> where
    Self: Sized
[src]

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

Loading content...

Provided methods

pub fn write(
    &mut self,
    full_pathname: &str,
    source: &mut Box<dyn Source>
) -> Result<(), DataError>
[src]

A function that writes to the given [Write] object to save its data

pub fn generation(&self) -> u64[src]

Implement this to support "generations" for detecting when the data for a given path is changed.

pub fn set_generation(&mut self, generation: u64)[src]

Implement this to support "generations" for detecting when the data for a given path is changed.

Loading content...

Implementors

Loading content...