[−][src]Trait keeshond_datapack::source::Source
Represents a location that packages can be loaded from. For example, you could load packages from the filesystem (via FilesystemSource, or out of a special archive format.
Required methods
fn get_uri(&self) -> &str
The path that this package originates from. Only used for debug purposes.
fn has_package(&self, package_name: &str) -> bool
Returns true if the Source has a package of the given name, otherwise returns false
fn read_file(
&mut self,
full_pathname: &str
) -> Result<Box<dyn Read>, PackageError>
&mut self,
full_pathname: &str
) -> Result<Box<dyn Read>, PackageError>
Returns a [Reader] for the file at the given pathname, if one exists.
fn iter_entries(
&mut self,
package_name: &str,
type_name: &str
) -> Box<dyn Iterator<Item = Result<String, PackageError>>>
&mut self,
package_name: &str,
type_name: &str
) -> Box<dyn Iterator<Item = Result<String, PackageError>>>
Returns an iterator through the items in a given package, if the Source has said package
Implementors
impl Source for FilesystemSource
[src]
fn get_uri(&self) -> &str
[src]
fn has_package(&self, package_name: &str) -> bool
[src]
fn read_file(
&mut self,
full_pathname: &str
) -> Result<Box<dyn Read>, PackageError>
[src]
&mut self,
full_pathname: &str
) -> Result<Box<dyn Read>, PackageError>
fn iter_entries(
&mut self,
package_name: &str,
type_name: &str
) -> Box<dyn Iterator<Item = Result<String, PackageError>>>
[src]
&mut self,
package_name: &str,
type_name: &str
) -> Box<dyn Iterator<Item = Result<String, PackageError>>>