[−][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
pub fn get_uri(&self) -> &str
[src]
The path that this Source originates from. Only used for debug purposes.
pub fn has_package(&self, package_name: &str) -> bool
[src]
Returns true if the Source has a package of the given name, otherwise returns false
pub fn list_packages(&mut self) -> Vec<String>
[src]
Returns a list of all packages available in this Source. Do not call this repeatedly!
pub fn read_file(
&mut self,
full_pathname: &str
) -> Result<Box<dyn ReadSeek>, PackageError>
[src]
&mut self,
full_pathname: &str
) -> Result<Box<dyn ReadSeek>, PackageError>
Returns a [Read] + [Seek] for the file at the given pathname, if one exists.
pub fn iter_entries(
&mut self,
package_name: &str,
type_folder: &str
) -> Box<dyn Iterator<Item = Result<String, PackageError>>>
[src]
&mut self,
package_name: &str,
type_folder: &str
) -> Box<dyn Iterator<Item = Result<String, PackageError>>>
Returns an iterator through the items in a given package, if the Source has said package
pub fn trust_level(&self, package_name: &str) -> TrustLevel
[src]
Returns the source's trust level for the given package. Trusted sources are able to load resource types marked as requiring trust.
Provided methods
pub fn write_file(
&mut self,
full_pathname: &str
) -> Result<Box<dyn Write>, PackageError>
[src]
&mut self,
full_pathname: &str
) -> Result<Box<dyn Write>, PackageError>
Returns a Write for the file at the given pathname.
Implementors
impl Source for FilesystemSource
[src]
pub fn get_uri(&self) -> &str
[src]
pub fn has_package(&self, package_name: &str) -> bool
[src]
pub fn list_packages(&mut self) -> Vec<String>
[src]
pub fn read_file(
&mut self,
full_pathname: &str
) -> Result<Box<dyn ReadSeek>, PackageError>
[src]
&mut self,
full_pathname: &str
) -> Result<Box<dyn ReadSeek>, PackageError>
pub fn write_file(
&mut self,
full_pathname: &str
) -> Result<Box<dyn Write>, PackageError>
[src]
&mut self,
full_pathname: &str
) -> Result<Box<dyn Write>, PackageError>
pub fn iter_entries(
&mut self,
package_name: &str,
type_folder: &str
) -> Box<dyn Iterator<Item = Result<String, PackageError>>>
[src]
&mut self,
package_name: &str,
type_folder: &str
) -> Box<dyn Iterator<Item = Result<String, PackageError>>>