Enum ether_dream_dac_emulator::stream::InterpretedCommand
[−]
[src]
pub enum InterpretedCommand { Known { command: Command, }, Unknown { start_byte: u8, }, }
An attempt at interpreting a Command from bytes.
Variants
Known
A successfuly interpreted, known command.
Fields of Known
command: Command |
Unknown
Received an unknown command that started with the given byte.
Fields of Unknown
start_byte: u8 |
Methods
impl InterpretedCommand
[src]
pub fn read_from_tcp_stream(
bytes: &mut [u8],
tcp_stream: &mut TcpStream
) -> Result<Self>
[src]
bytes: &mut [u8],
tcp_stream: &mut TcpStream
) -> Result<Self>
Read a single command from the TCP stream and return it.
This method blocks until the exact number of bytes necessary for the returned command are read.
Trait Implementations
impl Debug for InterpretedCommand
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more