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
impl Ruling
sourcepub async fn multiverse_id(id: usize) -> Result<ListIter<Self>>
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
);
sourcepub async fn mtgo_id(id: usize) -> Result<ListIter<Self>>
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
);
sourcepub async fn arena_id(id: usize) -> Result<ListIter<Self>>
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
);
sourcepub async fn set_and_number(set: &str, number: u32) -> Result<ListIter<Self>>
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
);
sourcepub async fn uuid(id: Uuid) -> Result<ListIter<Self>>
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<'de> Deserialize<'de> for Ruling
impl<'de> Deserialize<'de> for Ruling
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl PartialEq for Ruling
impl PartialEq for Ruling
impl Eq for Ruling
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> 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<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
key
and return true
if they are equal.