pub trait BundleReader {
// Required methods
fn id(&self) -> &'static str;
fn detect(&self, root: &Path) -> bool;
fn locate(&self, root: &Path, entry: Option<&str>) -> Result<BundleLocation>;
fn read(
&self,
bundle: &LocalBundle,
version_hint: Option<&str>,
) -> Result<ImportedPack>;
}Expand description
What an adapter crate implements to read its harness’s bundle format.
Required Methods§
Sourcefn detect(&self, root: &Path) -> bool
fn detect(&self, root: &Path) -> bool
Whether root holds a bundle or a listing of bundles in this format.
Sourcefn locate(&self, root: &Path, entry: Option<&str>) -> Result<BundleLocation>
fn locate(&self, root: &Path, entry: Option<&str>) -> Result<BundleLocation>
Find the bundle at root, or the one named entry in a listing.
§Errors
Returns an error when no bundle is found, or a listing holds several and none is named.
Sourcefn read(
&self,
bundle: &LocalBundle,
version_hint: Option<&str>,
) -> Result<ImportedPack>
fn read( &self, bundle: &LocalBundle, version_hint: Option<&str>, ) -> Result<ImportedPack>
Read a local bundle as a pack. version_hint is the version a release
tag named, for a bundle that declares none.
§Errors
Returns an error for a malformed bundle. Parts Tuff cannot carry are recorded as unsupported, not refused.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".