pub enum LinkDeclarations {
Unsplit,
Required,
Optional,
}Expand description
The declarations of a dependency that a ConditionalLink was derived
from.
Returned by ConditionalLink::declarations. For more information, see the
docs for that method.
Variants§
Unsplit
The link was not split by declaration, so it covers every declaration of the dependency.
Required
Only the declarations without optional = true.
Optional
Only the declarations with optional = true.
Implementations§
Source§impl LinkDeclarations
impl LinkDeclarations
Sourcepub fn includes_required(self) -> bool
pub fn includes_required(self) -> bool
Returns true if these declarations include the ones without
optional = true: that is, for Unsplit and
Required.
Prefer this to simply checking equality against Required. A link that
was not split by declaration is Unsplit, even if every declaration it
covers is a required one. For example, with:
[dependencies]
foo = { version = "1" }
[features]
a = ["foo/std"]the link from a to foo/std is Unsplit, not Required.
Sourcepub fn includes_optional(self) -> bool
pub fn includes_optional(self) -> bool
Returns true if these declarations include the ones with
optional = true: that is, for Unsplit and
Optional.
As with includes_required, prefer this to
checking equality against Optional.
Trait Implementations§
Source§impl Clone for LinkDeclarations
impl Clone for LinkDeclarations
Source§fn clone(&self) -> LinkDeclarations
fn clone(&self) -> LinkDeclarations
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for LinkDeclarations
Source§impl Debug for LinkDeclarations
impl Debug for LinkDeclarations
impl Eq for LinkDeclarations
Source§impl Hash for LinkDeclarations
impl Hash for LinkDeclarations
Source§impl PartialEq for LinkDeclarations
impl PartialEq for LinkDeclarations
Source§fn eq(&self, other: &LinkDeclarations) -> bool
fn eq(&self, other: &LinkDeclarations) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for LinkDeclarations
Auto Trait Implementations§
impl Freeze for LinkDeclarations
impl RefUnwindSafe for LinkDeclarations
impl Send for LinkDeclarations
impl Sync for LinkDeclarations
impl Unpin for LinkDeclarations
impl UnsafeUnpin for LinkDeclarations
impl UnwindSafe for LinkDeclarations
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
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