Enum rotor_stream::Exception []

pub enum Exception {
    EndOfStream,
    LimitReached,
    ReadError(Error),
    WriteError(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(Error)WriteError(Error)

Trait Implementations

impl Debug for Exception
[src]

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

Formats the value using the given formatter.

impl Display for Exception

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

Formats the value using the given formatter.

impl Error for Exception

fn description(&self) -> &str

A short description of the error. Read more

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

The lower-level cause of this error, if any. Read more