[−][src]Struct guppy::graph::feature::FeatureId
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]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'g> Ord for FeatureId<'g>
[src]
fn cmp(&self, other: &FeatureId<'g>) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<'g> PartialEq<FeatureId<'g>> for FeatureId<'g>
[src]
impl<'g> PartialOrd<FeatureId<'g>> for FeatureId<'g>
[src]
fn partial_cmp(&self, other: &FeatureId<'g>) -> Option<Ordering>
[src]
fn lt(&self, other: &FeatureId<'g>) -> bool
[src]
fn le(&self, other: &FeatureId<'g>) -> bool
[src]
fn gt(&self, other: &FeatureId<'g>) -> bool
[src]
fn ge(&self, other: &FeatureId<'g>) -> bool
[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]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<'a, T> DefaultFeatures<'a> for T where
T: 'a + Clone + Send + Sync,
[src]
T: 'a + Clone + Send + Sync,
fn clone_boxed(&self) -> Box<dyn DefaultFeatures<'a> + 'a>
[src]
fn self_address_mut(&mut self) -> *mut ()
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<'a, T> NonSyncFeatures<'a> for T where
T: 'a + Clone,
[src]
T: 'a + Clone,
fn clone_boxed(&self) -> Box<dyn NonSyncFeatures<'a> + 'a>
[src]
fn self_address_mut(&mut self) -> *mut ()
[src]
impl<T> SafeBorrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_replacement(ptr: &T) -> &T
[src]
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,