pub trait RamCommand {
// Required methods
fn command(&mut self, cmd: Command) -> Result<Response>;
fn send_data(&mut self, data: &[u8]) -> Result<Response>;
// Provided method
fn format_command(&self, cmd: &Command) -> String { ... }
}Expand description
RAM命令处理trait,定义了发送命令和数据的接口
Required Methods§
fn command(&mut self, cmd: Command) -> Result<Response>
fn send_data(&mut self, data: &[u8]) -> Result<Response>
Provided Methods§
fn format_command(&self, cmd: &Command) -> String
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".