pub struct CardDatabase { /* private fields */ }Implementations§
Source§impl CardDatabase
impl CardDatabase
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn get(&self, name: &str) -> Option<&'static CardRules>
pub fn archive(&self) -> Option<&'static ArchivedCardArchive>
pub fn get_by_card_name(&self, card_name: &str) -> Option<&'static CardRules>
pub fn iter(&self) -> Vec<(String, &'static CardRules)>
pub fn card_names(&self) -> Vec<String>
pub fn iter_card_keys(&self) -> Vec<String>
pub fn force_parse_all(&self) -> LoadResult
Sourcepub fn token_art_variants(&self) -> &HashMap<(String, String), usize>
pub fn token_art_variants(&self) -> &HashMap<(String, String), usize>
Access the raw token art variant map.
Sourcepub fn token_fallback(&self) -> &HashMap<String, String>
pub fn token_fallback(&self) -> &HashMap<String, String>
Access the raw token fallback map.
Sourcepub fn edition_dates(&self) -> &HashMap<String, String>
pub fn edition_dates(&self) -> &HashMap<String, String>
Access the edition release dates map.
Sourcepub fn card_default_edition(&self, card_name: &str) -> Option<&str>
pub fn card_default_edition(&self, card_name: &str) -> Option<&str>
Get the default edition for a card by name (lowercase).
Sourcepub fn token_art_variant_count(
&self,
token_script: &str,
edition_code: &str,
) -> usize
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).
Sourcepub fn token_edition_count(&self, token_script: &str) -> usize
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().
Sourcepub fn get_normalized_name<'a>(&'a self, card_name: &'a str) -> &'a str
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.
pub fn load_from_archive(archive_bytes: &[u8]) -> Result<ArchiveBundle, String>
Trait Implementations§
Source§impl Debug for CardDatabase
impl Debug for CardDatabase
Auto Trait Implementations§
impl !Freeze for CardDatabase
impl RefUnwindSafe for CardDatabase
impl Send for CardDatabase
impl Sync for CardDatabase
impl Unpin for CardDatabase
impl UnsafeUnpin for CardDatabase
impl UnwindSafe for CardDatabase
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.