[][src]Enum ether_dream_dac_emulator::stream::InterpretedCommand

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

Implementations

impl InterpretedCommand[src]

pub async fn read_from_tcp_stream<'_, '_>(
    bytes: &'_ mut [u8],
    tcp_stream: &'_ mut Async<TcpStream>
) -> Result<Self>
[src]

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]

impl From<Command> for InterpretedCommand[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.