pub enum FramingError {
FrameTooLarge {
limit: MaxFrameSize,
at_least: usize,
},
NotUtf8 {
valid_up_to: usize,
},
}Expand description
A frame that could not be framed.
A domain error: the framing layer knows about sizes and encodings and nothing
else, so nothing in it is an io::Error or a serde_json::Error, and an
adapter that hits a broken pipe maps that at its own boundary instead.
Every field is Copy, so the whole error is: it is a size and an offset,
and there is nothing in it worth owning twice.
Variants§
FrameTooLarge
A frame exceeded the decoder’s configured limit.
Raised while the bytes are still being read, so the decoder is holding at
most at_least bytes of the offending frame and the peer cannot make
that number grow by declining to send a terminator.
Fields
limit: MaxFrameSizeThe limit the caller configured.
NotUtf8
A frame’s bytes were not valid UTF-8.
Refused rather than replaced. A lossy decode would hand the next layer a message the peer did not send, and JSON-RPC ids are compared as text, so the corruption would surface as a routing bug rather than as an encoding one.
Trait Implementations§
Source§impl Clone for FramingError
impl Clone for FramingError
impl Copy for FramingError
Source§impl Debug for FramingError
impl Debug for FramingError
Source§impl Display for FramingError
impl Display for FramingError
impl Eq for FramingError
Source§impl Error for FramingError
impl Error for FramingError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()