In Routine§

See primary documentation in context for method candidates

method candidates(Routine:D: --> Positional:D)

Returns a list of multi candidates, or a one-element list with itself if it's not a multi

In CompUnit::Repository::Installation§

See primary documentation in context for method candidates

multi method candidates(Str:D $name:$auth:$ver:$api)
multi method candidates(CompUnit::DependencySpecification $spec)

Return all distributions that contain a module matching the specified $name, auth, ver, and api.

my $inst-repo-path = CompUnit::RepositoryRegistry.repository-for-name("perl").prefix;
my $inst-repo = CompUnit::Repository::Installation.new(prefix => $inst-repo-path);
my $dist = $inst-repo.candidates("Test").head;
say "Test version: " ~ $dist.meta<ver># OUTPUT: «6.d␤»

In CompUnit::Repository::FileSystem§

See primary documentation in context for method candidates

multi method candidates(Str:D $name:$auth:$ver:$api)
multi method candidates(CompUnit::DependencySpecification $spec)

Return all distributions that contain a module matching the specified $name, auth, ver, and api.

# assuming one is cloned into the zef git repository... 
my $repo = CompUnit::Repository::FileSystem.new(prefix => $*CWD);
with $repo.candidates("Zef").head -> $dist {
    say "Zef version: " ~ $dist.meta<version>;
}
else {
    say "No candidates for 'Zef' found";
}