#[non_exhaustive]pub enum BattleEvent {
Unimplemented,
GameVersion(GameVersion),
AvatarCreate(AvatarCreate),
EntityMethod(EntityMethodEvent),
Position(Position),
Chat(Chat),
}Expand description
This enum aims to represent all possible events that can occur in a battle. It’s variant should map to
each packet type and is expected to always be that type. For ex., a GameVersion packet has type 0x18
and is a variant of this enum. It is always be expected to be this type across all replays. Note that some
packet types like 0x08 may have children of its own. See EntityMethodEvent for more details.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Unimplemented
GameVersion(GameVersion)
AvatarCreate(AvatarCreate)
EntityMethod(EntityMethodEvent)
Position(Position)
Chat(Chat)
Implementations§
Source§impl BattleEvent
impl BattleEvent
Sourcepub fn parse(
packet: &Packet<'_>,
context: &Context,
) -> Result<BattleEvent, PacketError>
pub fn parse( packet: &Packet<'_>, context: &Context, ) -> Result<BattleEvent, PacketError>
Parse packet to a Battle event. Optional context is provided to aid in parsing some particular packets.
pub fn is_unknown(&self) -> bool
Trait Implementations§
Source§impl Clone for BattleEvent
impl Clone for BattleEvent
Source§fn clone(&self) -> BattleEvent
fn clone(&self) -> BattleEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BattleEvent
impl Debug for BattleEvent
Auto Trait Implementations§
impl Freeze for BattleEvent
impl RefUnwindSafe for BattleEvent
impl Send for BattleEvent
impl Sync for BattleEvent
impl Unpin for BattleEvent
impl UnwindSafe for BattleEvent
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