#[repr(C)]pub struct CoreCard {}Expand description
A card’s core data, whose memory layout is identical to ygocore’s CardData.
This is the FFI boundary structure passed to/from the core: the C++ card_reader
callback fills a *mut CoreCard, so the #[repr(C)] layout must match ygocore’s C++
struct byte-for-byte. Because the layout is shared, a CoreCard can be handed directly
to the core without conversion.
Fields§
§code: u32§alias: u32§setcode: [u16; 16]§card_type: Type§level: u32§attribute: Attribute§race: Race§attack: i32§defense: i32§left_scale: u32§right_scale: u32§link_marker: Linkmarkers§rule_code: u32Implementations§
Source§impl CoreCard
impl CoreCard
Sourcepub fn original_code(&self) -> u32
pub fn original_code(&self) -> u32
The code used to unify cards, falling back to code when there is no alias.
Sourcepub fn duel_code(&self) -> u32
pub fn duel_code(&self) -> u32
The code used in a duel, preferring the rule code over the original code.
Sourcepub fn is_setcodes(&self, value: u32) -> bool
pub fn is_setcodes(&self, value: u32) -> bool
Check whether any set code matches the given value.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CoreCard
impl RefUnwindSafe for CoreCard
impl Send for CoreCard
impl Sync for CoreCard
impl Unpin for CoreCard
impl UnsafeUnpin for CoreCard
impl UnwindSafe for CoreCard
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