pub trait ResolveTestArtifact {
// Required method
fn resolve(&self, id: ErasedArtifactHandle) -> Result<PathBuf, Error>;
// Provided method
fn resolve_source(
&self,
id: ErasedArtifactHandle,
) -> Result<ArtifactSource, Error> { ... }
}Expand description
A trait to resolve artifacts to paths.
Test authors are expected to use the TestArtifactRequirements and
TestArtifacts abstractions to interact with artifacts, and should not
use this API directly.
Required Methods§
Provided Methods§
Sourcefn resolve_source(
&self,
id: ErasedArtifactHandle,
) -> Result<ArtifactSource, Error>
fn resolve_source( &self, id: ErasedArtifactHandle, ) -> Result<ArtifactSource, Error>
Given an artifact handle, return its source (local path or remote URL).
The default implementation wraps the result of resolve
in ArtifactSource::Local. Override this to return
ArtifactSource::Remote for artifacts that are available at a URL
but not downloaded locally.