[][src]Struct scryfall::ruling::Ruling

pub struct Ruling {
    pub oracle_id: Uuid,
    pub source: Source,
    pub published_at: NaiveDate,
    pub comment: String,
}

A ruling object.

For documentation on it's fields refer to the ruling object on the official site.

Fields

oracle_id: Uuidsource: Sourcepublished_at: NaiveDatecomment: String

Methods

impl Ruling[src]

Important traits for PaginatedURI<T>
pub fn multiverse_id(id: usize) -> PaginatedURI<Self>[src]

Returns a List of rulings for a card with the given Multiverse ID. If the card has multiple multiverse IDs, this method can find either of them.

Examples

use scryfall::ruling::Ruling;
match Ruling::multiverse_id(3255).next() {
    Some(rulings) => assert_eq!(
        rulings
            .unwrap()
            .iter()
            .filter(|r| r.comment == "The ability is a mana ability, so it is activated and resolves as a mana ability, but it can only be activated at times when you can cast an instant. Yes, this is a bit weird.")
            .count(),
        1
    ),
    None => panic!("Nothing")
}

Important traits for PaginatedURI<T>
pub fn mtgo_id(id: usize) -> PaginatedURI<Self>[src]

Returns rulings for a card with the given MTGO ID (also known as the Catalog ID). The ID can either be the card’s mtgo_id or its mtgo_foil_id.

Examples

use scryfall::ruling::Ruling;
match Ruling::mtgo_id(57934).next() {
    Some(rulings) => assert_eq!(
        rulings
            .unwrap()
            .iter()
            .filter(|r| r.comment == "Yes, if the fourth mode is the only one remaining, you must choose it. You read the whole contract, right?")
            .count(),
        1
    ),
    None => panic!(),
}

Important traits for PaginatedURI<T>
pub fn arena_id(id: usize) -> PaginatedURI<Self>[src]

Returns rulings for a card with the given Magic: The Gathering Arena ID.

use scryfall::ruling::Ruling;
match Ruling::arena_id(67462).next() {
    Some(rulings) => assert_eq!(
        rulings
            .unwrap()
            .iter()
            .filter(|r| r.comment == "Once a chapter ability has triggered, the ability on the stack won’t be affected if the Saga gains or loses counters, or if it leaves the battlefield.")
            .count(),
        1
    ),
    None => panic!(),
}

Important traits for PaginatedURI<T>
pub fn set_and_number(set: &str, number: u32) -> PaginatedURI<Self>[src]

Returns a List of rulings for the card with the given set code and collector number.

Examples

use scryfall::ruling::Ruling;
match Ruling::set_and_number("ima", 65).next() {
    Some(rulings) => assert_eq!(
        rulings
            .unwrap()
            .iter()
            .filter(|r| r.comment == "If the target spell is an illegal target when Mana Drain tries to resolve, it won’t resolve and none of its effects will happen. You won’t get any mana.")
            .count(),
        1
    ),
    None => panic!(),
}

Important traits for PaginatedURI<T>
pub fn uuid(id: Uuid) -> PaginatedURI<Self>[src]

Returns a List of rulings for a card with the given Scryfall ID.

Examples

use scryfall::ruling::Ruling;
match Ruling::uuid("f2b9983e-20d4-4d12-9e2c-ec6d9a345787".to_string()).next() {
    Some(rulings) => assert_eq!(
        rulings
            .unwrap()
            .iter()
            .filter(|r| r.comment == "It must flip like a coin and not like a Frisbee.")
            .count(),
        1
    ),
    None => panic!(),
}

Trait Implementations

impl Clone for Ruling[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Ord for Ruling[src]

fn max(self, other: Self) -> Self1.21.0[src]

Compares and returns the maximum of two values. Read more

fn min(self, other: Self) -> Self1.21.0[src]

Compares and returns the minimum of two values. Read more

fn clamp(self, min: Self, max: Self) -> Self[src]

🔬 This is a nightly-only experimental API. (clamp)

Restrict a value to a certain interval. Read more

impl PartialOrd<Ruling> for Ruling[src]

impl PartialEq<Ruling> for Ruling[src]

impl Eq for Ruling[src]

impl Debug for Ruling[src]

impl Hash for Ruling[src]

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

Feeds a slice of this type into the given [Hasher]. Read more

impl Serialize for Ruling[src]

impl<'de> Deserialize<'de> for Ruling[src]

Auto Trait Implementations

impl Unpin for Ruling

impl Sync for Ruling

impl Send for Ruling

impl UnwindSafe for Ruling

impl RefUnwindSafe for Ruling

Blanket Implementations

impl<T> From<T> for T[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]

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

impl<T> Erased for T

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

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