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§
Sourcefn as_advance(&self) -> Option<Advance>
fn as_advance(&self) -> Option<Advance>
Attempt to cast as an Advance command.
Sourcefn parse_command_data(command_id: u8, reader: &[u8]) -> ReplayResult<Self>
fn parse_command_data(command_id: u8, reader: &[u8]) -> ReplayResult<Self>
Parse into a Command with given command id and buffer.
Sourcefn process_command(sim: &mut SimData, command: &Self) -> ReplayResult<()>
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".