Skip to main content

Command

Trait Command 

Source
pub trait Command:
    Sized
    + Debug
    + Display
    + Clone
    + PartialEq {
    // Required methods
    fn as_advance(&self) -> Option<Advance>;
    fn parse_command_data(command_id: u8, reader: &[u8]) -> ReplayResult<Self>;
    fn process_command(sim: &mut SimData, command: &Self) -> ReplayResult<()>;
}
Expand description

A trait that must be implemented for the enum that command data will be parsed into.

Required Methods§

Source

fn as_advance(&self) -> Option<Advance>

Attempt to cast as an Advance command.

Source

fn parse_command_data(command_id: u8, reader: &[u8]) -> ReplayResult<Self>

Parse into a Command with given command id and buffer.

Source

fn process_command(sim: &mut SimData, command: &Self) -> ReplayResult<()>

Update sim given the new command.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl Command for faf_replay_parser::sc2::replay::ReplayCommand

Source§

impl Command for faf_replay_parser::scfa::replay::ReplayCommand