pub trait CrateVersionResolver {
// Required method
fn resolve_latest(&self, crate_name: &str) -> Result<String>;
// Provided methods
fn resolve_latest_for_channel(
&self,
crate_name: &str,
_channel: ToolchainChannel,
) -> Result<String> { ... }
fn resolve_latest_in_lane(
&self,
crate_name: &str,
_lane: (u64, u64),
) -> Result<String> { ... }
fn resolve_research_version(
&self,
crate_name: &str,
) -> Result<ResearchVersion> { ... }
}Required Methods§
fn resolve_latest(&self, crate_name: &str) -> Result<String>
Provided Methods§
Sourcefn resolve_latest_for_channel(
&self,
crate_name: &str,
_channel: ToolchainChannel,
) -> Result<String>
fn resolve_latest_for_channel( &self, crate_name: &str, _channel: ToolchainChannel, ) -> Result<String>
Channel-aware resolution. The research (rnd) lane publishes base-name
crates at X.Y.Z-research PRERELEASES (greentic-runner’s
research-publish.yml), which resolve_latest’s max_stable_version
preference silently skips — so the dev/stable behaviour returns the old
stable (e.g. 0.5.x) instead of the current 1.2.0-research. The
default delegates to resolve_latest (correct for dev/stable).
Sourcefn resolve_latest_in_lane(
&self,
crate_name: &str,
_lane: (u64, u64),
) -> Result<String>
fn resolve_latest_in_lane( &self, crate_name: &str, _lane: (u64, u64), ) -> Result<String>
Resolve the latest version INSIDE a (major, minor) lane.
The dev channel needs this: greentic versions its lanes by minor (1.2.x dev, 1.3.x research), so “highest overall” lets an abandoned research build outrank an active dev one. The default ignores the lane, which is correct for resolvers that serve a single lane (the test fakes).
Sourcefn resolve_research_version(&self, crate_name: &str) -> Result<ResearchVersion>
fn resolve_research_version(&self, crate_name: &str) -> Result<ResearchVersion>
Resolve the research (-rnd) version, distinguishing an unpublished
crate (HTTP 404 → ResearchVersion::Absent) from a genuine resolution
error. The default treats every resolvable crate as
ResearchVersion::Pinned; only the crates.io resolver can observe a
404, so it overrides this.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".