Trait Resource

Source
pub trait Resource:
    Send
    + Sync
    + 'static {
    // Required methods
    fn version(&self, path: &str) -> Result<String, Error>;
    fn file(&self, path: &str) -> Result<Vec<u8>, Error>;
}
Expand description

Resource layer that can provide data to an ironworks instance.

Required Methods§

Source

fn version(&self, path: &str) -> Result<String, Error>

Get the version string for the file at path. A return value of Err(Error::NotFound(ErrorValue::Path(_))) will result in lookups continuing to the next resource.

Source

fn file(&self, path: &str) -> Result<Vec<u8>, Error>

Get the raw byte data for the file at path. A return value of Err(Error::NotFound(ErrorValue::Path(_))) will result in lookups continuing to the next resource.

Implementors§

Source§

impl<R> Resource for SqPack<R>
where R: Resource + Send + Sync + 'static,

Available on crate feature sqpack only.