cargo::core

Trait PackageIdSpecQuery

source
pub trait PackageIdSpecQuery {
    // Required methods
    fn query_str<I>(spec: &str, i: I) -> CargoResult<PackageId>
       where I: IntoIterator<Item = PackageId>;
    fn matches(&self, package_id: PackageId) -> bool;
    fn query<I>(&self, i: I) -> CargoResult<PackageId>
       where I: IntoIterator<Item = PackageId>;
}

Required Methods§

source

fn query_str<I>(spec: &str, i: I) -> CargoResult<PackageId>
where I: IntoIterator<Item = PackageId>,

Roughly equivalent to PackageIdSpec::parse(spec)?.query(i)

source

fn matches(&self, package_id: PackageId) -> bool

Checks whether the given PackageId matches the PackageIdSpec.

source

fn query<I>(&self, i: I) -> CargoResult<PackageId>
where I: IntoIterator<Item = PackageId>,

Checks a list of PackageIds to find 1 that matches this PackageIdSpec. If 0, 2, or more are found, then this returns an error.

Object Safety§

This trait is not object safe.

Implementors§