cargo::core::package_id_spec

# 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 `PackageId`s to find 1 that matches this `PackageIdSpec`. If 0, 2, or more are found, then this returns an error.

## Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

## Implementors§

Source§

### impl PackageIdSpecQuery for PackageIdSpec