[][src]Struct guppy::graph::feature::FeatureId

pub struct FeatureId<'g> { /* fields omitted */ }

An identifier for a (package, feature) pair in a feature graph.

Returned by various methods on FeatureGraph and FeatureQuery.

From impls are available for (&'g PackageId, &'g str) and (&'g PackageId, Option<&'g str>) tuples.

Implementations

impl<'g> FeatureId<'g>[src]

pub fn new(package_id: &'g PackageId, feature: &'g str) -> Self[src]

Creates a new FeatureId.

pub fn base(package_id: &'g PackageId) -> Self[src]

Creates a new FeatureId representing the "base" feature for a package.

pub fn package_id(&self) -> &'g PackageId[src]

Returns the package ID.

pub fn feature(&self) -> Option<&'g str>[src]

Returns the name of the feature, or None if this is the "base" feature for this package.

pub fn is_base(&self) -> bool[src]

Returns true if this is the "base" feature for the package.

Trait Implementations

impl<'g> Clone for FeatureId<'g>[src]

impl<'g> Copy for FeatureId<'g>[src]

impl<'g> Debug for FeatureId<'g>[src]

impl<'g> Display for FeatureId<'g>[src]

The Display impl prints out {package id}/feature, or {package id}/[base].

Examples

use guppy::PackageId;
use guppy::graph::feature::FeatureId;

let package_id = PackageId::new("region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)");

assert_eq!(
    format!("{}", FeatureId::new(&package_id, "foo")),
    "region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)/foo"
);

assert_eq!(
    format!("{}", FeatureId::base(&package_id)),
    "region 2.1.2 (registry+https://github.com/rust-lang/crates.io-index)/[base]"
);

impl<'g> Eq for FeatureId<'g>[src]

impl<'g> From<(&'g PackageId, &'g str)> for FeatureId<'g>[src]

impl<'g> From<(&'g PackageId, Option<&'g str>)> for FeatureId<'g>[src]

impl<'g> From<FeatureId<'g>> for (PackageId, Option<String>)[src]

impl<'g> Hash for FeatureId<'g>[src]

impl<'g> Ord for FeatureId<'g>[src]

impl<'g> PartialEq<FeatureId<'g>> for FeatureId<'g>[src]

impl<'g> PartialOrd<FeatureId<'g>> for FeatureId<'g>[src]

impl<'g> StructuralEq for FeatureId<'g>[src]

impl<'g> StructuralPartialEq for FeatureId<'g>[src]

Auto Trait Implementations

impl<'g> RefUnwindSafe for FeatureId<'g>

impl<'g> Send for FeatureId<'g>

impl<'g> Sync for FeatureId<'g>

impl<'g> Unpin for FeatureId<'g>

impl<'g> UnwindSafe for FeatureId<'g>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<'a, T> DefaultFeatures<'a> for T where
    T: 'a + Clone + Send + Sync
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<'a, T> NonSyncFeatures<'a> for T where
    T: 'a + Clone
[src]

impl<T> SafeBorrow<T> for T where
    T: ?Sized
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,