rotor_stream/errors.rs
1use std::fmt;
2use std::error::Error;
3
4/// Protocol returned None right at the start of the stream processing
5#[derive(Debug)]
6pub struct ProtocolStop;
7
8impl fmt::Display for ProtocolStop {
9 fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
10 write!(fmt, "ProtocolStop")
11 }
12}
13
14impl Error for ProtocolStop {
15 fn cause(&self) -> Option<&Error> { None }
16 fn description(&self) -> &'static str {
17 r#"Protocol returned None (which means "stop") at start"#
18 }
19}