pub struct ArtifactResolver<'a> { /* private fields */ }Expand description
An artifact resolver, used both to express requirements for artifacts and to resolve them to paths.
Implementations§
Source§impl<'a> ArtifactResolver<'a>
impl<'a> ArtifactResolver<'a>
Sourcepub fn set_remote_policy(&mut self, test_policy: RemoteAccess)
pub fn set_remote_policy(&mut self, test_policy: RemoteAccess)
Returns the remote access policy, checking the
PETRI_REMOTE_ARTIFACTS environment variable.
Set PETRI_REMOTE_ARTIFACTS=0 to force all artifacts to be resolved
locally, even if RemoteAccess::Allow is specified per-call or per-test.
Sourcepub fn collector(requirements: &'a mut TestArtifactRequirements) -> Self
pub fn collector(requirements: &'a mut TestArtifactRequirements) -> Self
Returns a resolver to collect requirements; the artifact objects returned by
require will panic if used.
Sourcepub fn resolver(artifacts: &'a TestArtifacts) -> Self
pub fn resolver(artifacts: &'a TestArtifacts) -> Self
Returns a resolver to resolve artifacts.
Sourcepub fn require<A: ArtifactId>(
&self,
handle: ArtifactHandle<A>,
) -> ResolvedArtifact<A>
pub fn require<A: ArtifactId>( &self, handle: ArtifactHandle<A>, ) -> ResolvedArtifact<A>
Resolve a required artifact. The artifact must be available locally.
Sourcepub fn try_require<A: ArtifactId>(
&self,
handle: ArtifactHandle<A>,
) -> ResolvedOptionalArtifact<A>
pub fn try_require<A: ArtifactId>( &self, handle: ArtifactHandle<A>, ) -> ResolvedOptionalArtifact<A>
Resolve an optional artifact.
Sourcepub fn require_source<A: ArtifactId>(
&self,
handle: ArtifactHandle<A>,
remote: RemoteAccess,
) -> ResolvedArtifactSource<A>
pub fn require_source<A: ArtifactId>( &self, handle: ArtifactHandle<A>, remote: RemoteAccess, ) -> ResolvedArtifactSource<A>
Resolve an artifact, returning either a local path or a remote URL.
The remote parameter controls whether a remote URL is acceptable for
this particular artifact. The resolver’s configured remote policy may
further restrict this request and force the effective access mode to
LocalOnly.