Skip to main content

CardDatabase

Struct CardDatabase 

Source
pub struct CardDatabase { /* private fields */ }

Implementations§

Source§

impl CardDatabase

Source

pub fn new() -> Self

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn get(&self, name: &str) -> Option<&'static CardRules>

Source

pub fn archive(&self) -> Option<&'static ArchivedCardArchive>

Source

pub fn get_by_card_name(&self, card_name: &str) -> Option<&'static CardRules>

Source

pub fn iter(&self) -> Vec<(String, &'static CardRules)>

Source

pub fn card_names(&self) -> Vec<String>

Source

pub fn iter_card_keys(&self) -> Vec<String>

Source

pub fn force_parse_all(&self) -> LoadResult

Source

pub fn token_art_variants(&self) -> &HashMap<(String, String), usize>

Access the raw token art variant map.

Source

pub fn token_fallback(&self) -> &HashMap<String, String>

Access the raw token fallback map.

Source

pub fn edition_dates(&self) -> &HashMap<String, String>

Access the edition release dates map.

Source

pub fn card_default_edition(&self, card_name: &str) -> Option<&str>

Get the default edition for a card by name (lowercase).

Source

pub fn token_art_variant_count( &self, token_script: &str, edition_code: &str, ) -> usize

Get the number of art variants for a token script in a given edition. Follows TokenFallbackCode chains to find the edition that has the token. Returns 1 if not found (single variant assumed).

Source

pub fn token_edition_count(&self, token_script: &str) -> usize

Number of editions that contain a given token script. Mirrors the size of the Set<String> passed to Aggregates.random() in Java’s TokenDb.loadTokenFromSet().

Source

pub fn get_normalized_name<'a>(&'a self, card_name: &'a str) -> &'a str

Mirror of Java’s CardDb.getNormalizedName(). If the given name is an accent-stripped variant, returns the original name.

Source

pub fn load_from_archive(archive_bytes: &[u8]) -> Result<ArchiveBundle, String>

Trait Implementations§

Source§

impl Debug for CardDatabase

Source§

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

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

impl Default for CardDatabase

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> ArchivePointee for T

Source§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
Source§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

Source§

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> LayoutRaw for T

Source§

fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>

Gets the layout of the type.
Source§

impl<T> Pointee for T

Source§

type Metadata = ()

The type for metadata in pointers and references to Self.
Source§

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

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V