Enum rotor_stream::Exception []

pub enum Exception {
    EndOfStream,
    LimitReached,
    ReadError(Error),
    WriteError(Error),
    ConnectError(Error),
}

An exception value that is received in Protocol::exception method

This thing is usually used for nice error detection. But sometimes it is also useful for valid protocol processing. For example it allows to detect end-of-stream-delimited prootols (of those which make of use of TCP half close)

Variants

EndOfStream

End of stream reached (when reading)

This may be not a broken expectation, we just notify of end of stream always (if the state machine is still alive)

Note: the equivalent of end of stream for write system call is translated to WriteError(WriteZero)

LimitReached

Limit for the number of bytes reached

This is called when there is alredy maximum bytes in the buffer (third argument of Delimiter) but no delimiter found.

ReadError
WriteError
ConnectError

Trait Implementations

impl Display for Exception

fn fmt(&self, fmt: &mut Formatter) -> Result

impl Error for Exception

fn description(&self) -> &str

fn cause(&self) -> Option<&Error>

Derived Implementations

impl Debug for Exception

fn fmt(&self, __arg_0: &mut Formatter) -> Result