pub enum PackageFilterElement {
Toolchain(String),
}Expand description
One of elements with which to filter required packages.
Variants§
Toolchain(String)
Requires toolchain to be specified to the specified toolchain.
Parsed name: "toolchain".
Implementations§
Source§impl PackageFilterElement
impl PackageFilterElement
Sourcepub fn parse(from: &str) -> Result<PackageFilterElement, String>
pub fn parse(from: &str) -> Result<PackageFilterElement, String>
Parse one filter specifier into up to one package filter
§Examples
assert_eq!(PackageFilterElement::parse("toolchain=nightly"),
Ok(PackageFilterElement::Toolchain("nightly".to_string())));
assert!(PackageFilterElement::parse("capitalism").is_err());
assert!(PackageFilterElement::parse("communism=good").is_err());Sourcepub fn matches(&self, cfg: &PackageConfig) -> bool
pub fn matches(&self, cfg: &PackageConfig) -> bool
Check if the specified package config matches this filter element.
§Examples
assert!(PackageFilterElement::Toolchain("nightly".to_string())
.matches(&PackageConfig::from(&[ConfigOperation::SetToolchain("nightly".to_string())])));
assert!(!PackageFilterElement::Toolchain("nightly".to_string()).matches(&PackageConfig::from(&[])));Trait Implementations§
Source§impl Clone for PackageFilterElement
impl Clone for PackageFilterElement
Source§fn clone(&self) -> PackageFilterElement
fn clone(&self) -> PackageFilterElement
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PackageFilterElement
impl Debug for PackageFilterElement
Source§impl Hash for PackageFilterElement
impl Hash for PackageFilterElement
Source§impl Ord for PackageFilterElement
impl Ord for PackageFilterElement
Source§fn cmp(&self, other: &PackageFilterElement) -> Ordering
fn cmp(&self, other: &PackageFilterElement) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for PackageFilterElement
impl PartialEq for PackageFilterElement
Source§impl PartialOrd for PackageFilterElement
impl PartialOrd for PackageFilterElement
impl Eq for PackageFilterElement
impl StructuralPartialEq for PackageFilterElement
Auto Trait Implementations§
impl Freeze for PackageFilterElement
impl RefUnwindSafe for PackageFilterElement
impl Send for PackageFilterElement
impl Sync for PackageFilterElement
impl Unpin for PackageFilterElement
impl UnwindSafe for PackageFilterElement
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.