pub struct CardDb {
pub cards: Vec<CardStatic>,
/* private fields */
}Fields§
§cards: Vec<CardStatic>Implementations§
Source§impl CardDb
impl CardDb
pub fn new(cards: Vec<CardStatic>) -> Result<Self>
pub fn load<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_wsdb_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_postcard_payload(payload: &[u8]) -> Result<Self>
pub fn get(&self, id: CardId) -> Option<&CardStatic>
pub fn schema_version() -> u32
pub fn to_bytes_with_header(&self) -> Result<Vec<u8>>
pub fn iter_card_abilities_in_canonical_order( &self, card_id: CardId, ) -> &[AbilitySpec]
pub fn compiled_effects_for_ability( &self, card_id: CardId, ability_index: usize, ) -> &[EffectSpec]
pub fn compiled_effects_flat(&self, card_id: CardId) -> Vec<EffectSpec>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for CardDb
impl<'de> Deserialize<'de> for CardDb
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>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for CardDb
impl RefUnwindSafe for CardDb
impl Send for CardDb
impl Sync for CardDb
impl Unpin for CardDb
impl UnwindSafe for CardDb
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more