Skip to main content

BundleReader

Trait BundleReader 

Source
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§

Source

fn id(&self) -> &'static str

The format id, such as claude-plugin.

Source

fn detect(&self, root: &Path) -> bool

Whether root holds a bundle or a listing of bundles in this format.

Source

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.

Source

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".

Implementors§