pub trait DriverAdapter {
// Required methods
fn driver(&self) -> &'static str;
fn read_version(&self, root: &Utf8Path) -> Result<Version, RkError>;
fn write_version(
&self,
root: &Utf8Path,
version: Version,
) -> Result<Vec<Utf8PathBuf>, RkError>;
fn build(
&self,
root: &Utf8Path,
epoch: &str,
) -> Result<Vec<Utf8PathBuf>, RkError>;
fn packed(
&self,
root: &Utf8Path,
rev: &str,
) -> Result<BTreeSet<String>, RkError>;
fn nothing_packed(&self) -> String;
// Provided method
fn tag_of(&self, version: Version) -> String { ... }
}Expand description
What the engine asks of a driver: its version, read and written through the native tool, the tag a version takes, and its build.
The registry upload stays in CI, where the publishing identity is the job, so the trait has no publish method.
Required Methods§
Sourcefn read_version(&self, root: &Utf8Path) -> Result<Version, RkError>
fn read_version(&self, root: &Utf8Path) -> Result<Version, RkError>
The version the target carries now.
§Errors
A refusal where the version cannot be read or is not one release-kit releases.
Sourcefn write_version(
&self,
root: &Utf8Path,
version: Version,
) -> Result<Vec<Utf8PathBuf>, RkError>
fn write_version( &self, root: &Utf8Path, version: Version, ) -> Result<Vec<Utf8PathBuf>, RkError>
Write version and return every file the write changed, relative
to root.
§Errors
The native tool’s failure.
Sourcefn build(
&self,
root: &Utf8Path,
epoch: &str,
) -> Result<Vec<Utf8PathBuf>, RkError>
fn build( &self, root: &Utf8Path, epoch: &str, ) -> Result<Vec<Utf8PathBuf>, RkError>
Build the release artifacts into dist/ and return them, relative
to root. epoch is the commit time, set as SOURCE_DATE_EPOCH.
§Errors
The build’s failure, or a build that left no artifact.
Sourcefn packed(
&self,
root: &Utf8Path,
rev: &str,
) -> Result<BTreeSet<String>, RkError>
fn packed( &self, root: &Utf8Path, rev: &str, ) -> Result<BTreeSet<String>, RkError>
The files the release packs at the revision rev of the checkout
at root, each a tracked file of that revision, relative to the
root. A python build runs in a temporary worktree outside the
checkout, and a bash list reads the revision’s tree alone.
SATISFIES release-engine:a-request-follows-the-packed-files
§Errors
The build’s failure, or a package that holds no tracked file.
Sourcefn nothing_packed(&self) -> String
fn nothing_packed(&self) -> String
Why the request opens nothing where neither revision packs a file past rk’s own.
Provided Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".