Struct scryfall::ruling::Ruling

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

§Rulings represent Oracle rulings, Wizards of the Coast set release notes, or Scryfall notes for a particular card.

For more information, refer to the official docs.

Fields§

§oracle_id: Uuid

A unique ID for the oracle identity of the card this ruling is about. This value is consistent across reprinted card editions, and unique among different cards with the same name (tokens, Unstable variants, etc).

§source: Source

A computer-readable string indicating which company produced this ruling, either wotc or scryfall.

§published_at: NaiveDate

The date when the ruling or note was published.

§comment: String

The text of the ruling.

Implementations§

source§

impl Ruling

source

pub async fn multiverse_id(id: usize) -> Result<ListIter<Self>>

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;
use futures::stream::StreamExt;
use futures::future;
assert!(
    Ruling::multiverse_id(3255)
        .await
        .unwrap()
        .into_stream()
        .map(Result::unwrap)
        .any(|r| future::ready(r.comment.ends_with("Yes, this is a bit weird.")))
        .await
);
use scryfall::ruling::Ruling;
use futures::stream::StreamExt;
use futures::future;
assert!(
    Ruling::multiverse_id(3255)
        .await
        .unwrap()
        .into_stream_buffered(10)
        .map(Result::unwrap)
        .any(|r| future::ready(r.comment.ends_with("Yes, this is a bit weird.")))
        .await
);
source

pub async fn mtgo_id(id: usize) -> Result<ListIter<Self>>

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;
use futures::stream::StreamExt;
use futures::future;
assert!(
    Ruling::mtgo_id(57934)
        .await
        .unwrap()
        .into_stream()
        .map(Result::unwrap)
        .any(|r| future::ready(r.comment.ends_with("You read the whole contract, right?")))
        .await
);
use scryfall::ruling::Ruling;
use futures::stream::StreamExt;
use futures::future;
assert!(
    Ruling::mtgo_id(57934)
        .await
        .unwrap()
        .into_stream_buffered(10)
        .map(Result::unwrap)
        .any(|r| future::ready(r.comment.ends_with("You read the whole contract, right?")))
        .await
);
source

pub async fn arena_id(id: usize) -> Result<ListIter<Self>>

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

use scryfall::ruling::Ruling;
use futures::stream::StreamExt;
use futures::future;
assert!(
    Ruling::arena_id(67462)
        .await
        .unwrap()
        .into_stream()
        .map(Result::unwrap)
        .any(|r| {
            future::ready(r.comment
                .starts_with("Once a chapter ability has triggered,"))
        })
        .await
);
use scryfall::ruling::Ruling;
use futures::stream::StreamExt;
use futures::future;
assert!(
    Ruling::arena_id(67462)
        .await
        .unwrap()
        .into_stream_buffered(10)
        .map(Result::unwrap)
        .any(|r| {
            future::ready(r.comment
                .starts_with("Once a chapter ability has triggered,"))
        })
        .await
);
source

pub async fn set_and_number(set: &str, number: u32) -> Result<ListIter<Self>>

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

§Examples
use scryfall::ruling::Ruling;
use futures::stream::StreamExt;
use futures::future;
assert!(
    Ruling::set_and_number("bfz", 17)
        .await
        .unwrap()
        .into_stream()
        .map(Result::unwrap)
        .any(|r| future::ready(r.comment == "Yes, your opponent can’t even. We know."))
        .await
);
use scryfall::ruling::Ruling;
use futures::stream::StreamExt;
use futures::future;
assert!(
    Ruling::set_and_number("bfz", 17)
        .await
        .unwrap()
        .into_stream_buffered(10)
        .map(Result::unwrap)
        .any(|r| future::ready(r.comment == "Yes, your opponent can’t even. We know."))
        .await
);
source

pub async fn uuid(id: Uuid) -> Result<ListIter<Self>>

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

§Examples
use scryfall::ruling::Ruling;
use futures::stream::StreamExt;
use futures::future;
assert!(
    Ruling::uuid("f2b9983e-20d4-4d12-9e2c-ec6d9a345787".parse().unwrap())
        .await
        .unwrap()
        .into_stream()
        .map(Result::unwrap)
        .any(|r| future::ready(r.comment == "It must flip like a coin and not like a Frisbee."))
        .await
);
use scryfall::ruling::Ruling;
use futures::stream::StreamExt;
use futures::future;
assert!(
    Ruling::uuid("f2b9983e-20d4-4d12-9e2c-ec6d9a345787".parse().unwrap())
        .await
        .unwrap()
        .into_stream_buffered(10)
        .map(Result::unwrap)
        .any(|r| future::ready(r.comment == "It must flip like a coin and not like a Frisbee."))
        .await
);

Trait Implementations§

source§

impl Clone for Ruling

source§

fn clone(&self) -> Ruling

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 Debug for Ruling

source§

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

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

impl<'de> Deserialize<'de> for Ruling

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Hash for Ruling

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 PartialEq for Ruling

source§

fn eq(&self, other: &Ruling) -> 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 Serialize for Ruling

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Ruling

source§

impl StructuralPartialEq for Ruling

Auto Trait Implementations§

§

impl Freeze for Ruling

§

impl RefUnwindSafe for Ruling

§

impl Send for Ruling

§

impl Sync for Ruling

§

impl Unpin for Ruling

§

impl UnwindSafe for Ruling

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> 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> 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, 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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,