Enum pkgcraft::dep::Dependency

source ·
pub enum Dependency<T: Ordered> {
    Enabled(T),
    Disabled(T),
    AllOf(SortedSet<Box<Dependency<T>>>),
    AnyOf(OrderedSet<Box<Dependency<T>>>),
    ExactlyOneOf(OrderedSet<Box<Dependency<T>>>),
    AtMostOneOf(OrderedSet<Box<Dependency<T>>>),
    Conditional(UseDep, SortedSet<Box<Dependency<T>>>),
}
Expand description

Dependency specification variants.

Variants§

§

Enabled(T)

Enabled dependency.

§

Disabled(T)

Disabled dependency (REQUIRED_USE only).

§

AllOf(SortedSet<Box<Dependency<T>>>)

All of a given dependency set.

§

AnyOf(OrderedSet<Box<Dependency<T>>>)

Any of a given dependency set.

§

ExactlyOneOf(OrderedSet<Box<Dependency<T>>>)

Exactly one of a given dependency set (REQUIRED_USE only).

§

AtMostOneOf(OrderedSet<Box<Dependency<T>>>)

At most one of a given dependency set (REQUIRED_USE only).

§

Conditional(UseDep, SortedSet<Box<Dependency<T>>>)

Conditional dependency.

Implementations§

source§

impl<T: Ordered> Dependency<T>

source

pub fn is_empty(&self) -> bool

source

pub fn len(&self) -> usize

Return the number of Dependency objects a Dependency contains.

source

pub fn iter(&self) -> Iter<'_, T>

source

pub fn iter_flatten(&self) -> IterFlatten<'_, T>

source

pub fn iter_recursive(&self) -> IterRecursive<'_, T>

source

pub fn iter_conditionals(&self) -> IterConditionals<'_, T>

source

pub fn sort(&mut self)

Recursively sort a Dependency.

source§

impl Dependency<Dep>

source

pub fn package(s: &str, eapi: &'static Eapi) -> Result<Self>

source§

impl Dependency<String>

source

pub fn license(s: &str) -> Result<Self>

source

pub fn properties(s: &str) -> Result<Self>

source

pub fn required_use(s: &str) -> Result<Self>

source

pub fn restrict(s: &str) -> Result<Self>

source§

impl Dependency<Uri>

source

pub fn src_uri(s: &str) -> Result<Self>

Trait Implementations§

source§

impl<T: Clone + Ordered> Clone for Dependency<T>

source§

fn clone(&self) -> Dependency<T>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'a, T: Ordered> Conditionals for &'a Dependency<T>

source§

impl<T: Ordered> Conditionals for Dependency<T>

source§

impl<T: Ordered> Contains<&Dependency<T>> for Dependency<T>

source§

fn contains(&self, dep: &Self) -> bool

source§

impl<T: Ordered> Contains<&Dependency<T>> for DependencySet<T>

source§

fn contains(&self, dep: &Dependency<T>) -> bool

source§

impl<T: Ordered> Contains<&T> for Dependency<T>

source§

fn contains(&self, obj: &T) -> bool

source§

impl Contains<&UseDep> for Dependency<Dep>

source§

fn contains(&self, obj: &UseDep) -> bool

source§

impl Contains<&UseDep> for Dependency<String>

source§

fn contains(&self, obj: &UseDep) -> bool

source§

impl Contains<&UseDep> for Dependency<Uri>

source§

fn contains(&self, obj: &UseDep) -> bool

source§

impl Contains<&str> for Dependency<Dep>

source§

fn contains(&self, obj: &str) -> bool

source§

impl<T: Ordered + AsRef<str>> Contains<&str> for Dependency<T>

source§

fn contains(&self, obj: &str) -> bool

source§

impl<T: Debug + Ordered> Debug for Dependency<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Display + Ordered> Display for Dependency<T>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'a, S: Stringable + 'a, T: Ordered> Evaluate<'a, S> for &'a Dependency<T>

§

type Evaluated = SortedSet<Dependency<&'a T>>

source§

fn evaluate(self, options: &'a IndexSet<S>) -> Self::Evaluated

§

type Item = Dependency<&'a T>

§

type IntoIterEvaluate = IterEvaluate<'a, S, T>

source§

fn into_iter_evaluate(self, options: &'a IndexSet<S>) -> Self::IntoIterEvaluate

source§

impl<'a, S: Stringable + 'a, T: Ordered> Evaluate<'a, S> for Dependency<&'a T>

source§

impl<'a, T: Ordered> EvaluateForce for &'a Dependency<T>

source§

impl<'a, T: Ordered> EvaluateForce for Dependency<&'a T>

source§

impl<'a, T: Ordered> Flatten for &'a Dependency<T>

source§

impl<T: Ordered> Flatten for Dependency<T>

source§

impl<'a, T: Ordered + 'a> FromIterator<&'a Dependency<T>> for DependencySet<&'a T>

source§

fn from_iter<I: IntoIterator<Item = &'a Dependency<T>>>(iterable: I) -> Self

Creates a value from an iterator. Read more
source§

impl<'a, T: Ordered> FromIterator<&'a Dependency<T>> for Iter<'a, T>

source§

fn from_iter<I: IntoIterator<Item = &'a Dependency<T>>>(iterable: I) -> Self

Creates a value from an iterator. Read more
source§

impl<T: Ordered> FromIterator<Dependency<T>> for DependencySet<T>

source§

fn from_iter<I: IntoIterator<Item = Dependency<T>>>(iterable: I) -> Self

Creates a value from an iterator. Read more
source§

impl<T: Ordered> FromIterator<Dependency<T>> for IntoIter<T>

source§

fn from_iter<I: IntoIterator<Item = Dependency<T>>>(iterable: I) -> Self

Creates a value from an iterator. Read more
source§

impl<T: Hash + Ordered> Hash for Dependency<T>

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<'a, T: Ordered> IntoIterator for &'a Dependency<T>

§

type Item = &'a Dependency<T>

The type of the elements being iterated over.
§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T: Ordered> IntoIterator for Dependency<T>

§

type Item = Dependency<T>

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T: Ordered> IntoOwned for Dependency<&T>

§

type Owned = Dependency<T>

source§

fn into_owned(self) -> Self::Owned

source§

impl<T: Ord + Ordered> Ord for Dependency<T>

source§

fn cmp(&self, other: &Dependency<T>) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
source§

impl<T: PartialEq + Ordered> PartialEq for Dependency<T>

source§

fn eq(&self, other: &Dependency<T>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T: PartialOrd + Ordered> PartialOrd for Dependency<T>

source§

fn partial_cmp(&self, other: &Dependency<T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<'a, T: Ordered> Recursive for &'a Dependency<T>

source§

impl<T: Ordered> Recursive for Dependency<T>

source§

impl Restriction<&Dependency<Dep>> for Restrict

source§

fn matches(&self, val: &Dependency<Dep>) -> bool

source§

impl<'a, T: Ordered + 'a> ToRef<'a> for Dependency<T>

§

type Ref = Dependency<&'a T>

source§

fn to_ref(&'a self) -> Self::Ref

source§

impl<T: Eq + Ordered> Eq for Dependency<T>

source§

impl<T: Ordered> StructuralPartialEq for Dependency<T>

Auto Trait Implementations§

§

impl<T> Freeze for Dependency<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for Dependency<T>
where T: RefUnwindSafe,

§

impl<T> Send for Dependency<T>
where T: Send,

§

impl<T> Sync for Dependency<T>
where T: Sync,

§

impl<T> Unpin for Dependency<T>
where T: Unpin,

§

impl<T> UnwindSafe for Dependency<T>
where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
source§

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

source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
source§

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

source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> IntoEither for T

source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
source§

impl<T> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> Ordered for T
where T: Debug + PartialEq + Eq + PartialOrd + Ord + Clone + Hash,