pub struct Compare<T> { /* private fields */ }
Expand description
An operator and RHS for a comparison expression of a parameter.
To construct an instance, use one of the helper functions from the
compare
module: lt
, lte
, gt
, gte
, eq
, or
neq
.
§Example
let query = cmc(gte(5)).and(type_line("planeswalker"));
let card = query.random().await.unwrap();
assert!(card.cmc.unwrap() as u32 >= 5);
assert!(card.type_line.unwrap().to_lowercase().contains("planeswalker"));
Trait Implementations§
source§impl<T: ParamValue> ParamValue for Compare<T>
impl<T: ParamValue> ParamValue for Compare<T>
source§impl<T: PartialEq> PartialEq for Compare<T>
impl<T: PartialEq> PartialEq for Compare<T>
impl<T: ColorValue> ColorValue for Compare<T>
impl<T: DateValue> DateValue for Compare<T>
impl DevotionValue for Compare<Devotion>
impl<T: Eq> Eq for Compare<T>
impl<T: NumericComparableValue> NumericComparableValue for Compare<T>
impl RarityValue for Compare<Rarity>
impl<T: TextValue> RarityValue for Compare<T>
impl<T> StructuralPartialEq for Compare<T>
Auto Trait Implementations§
impl<T> Freeze for Compare<T>where
T: Freeze,
impl<T> RefUnwindSafe for Compare<T>where
T: RefUnwindSafe,
impl<T> Send for Compare<T>where
T: Send,
impl<T> Sync for Compare<T>where
T: Sync,
impl<T> Unpin for Compare<T>where
T: Unpin,
impl<T> UnwindSafe for Compare<T>where
T: UnwindSafe,
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<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.