Skip to main content

DriverAdapter

Trait DriverAdapter 

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

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

Source

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

The driver’s name, as the record states it.

Source

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.

Source

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.

Source

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.

Provided Methods§

Source

fn tag_of(&self, version: Version) -> String

The tag a version releases as.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§