pub enum FramingError {
InvalidFrame {
frame_len: usize,
reason: &'static str,
},
PartialFrame {
needed: usize,
remaining: usize,
},
}Expand description
Framing error.
Variants§
InvalidFrame
An invalid frame was received.
This generally occurs if the frame is corrupted in some way, due to a bug in how the frame was encoded or sent/received. For example, if a length-delimited frame indicates that the frame is larger than the buffer can handle, it generally indicates that frame was created incorrectly by not respecting the maximum frame length limitations, or the buffer is corrupt and spurious bytes are contributing to a decoded frame length that is nonsensical.
PartialFrame
Failed to read frame due to a partial frame after reaching EOF.
This generally only occurs if the peer closes their connection before sending the entire frame, or if a partial write occurs on a connectionless stream, such as UDP, perhaps due to fragmentation.
Trait Implementations§
Source§impl Debug for FramingError
impl Debug for FramingError
Source§impl Display for FramingError
impl Display for FramingError
Source§impl Error for FramingError
impl Error for FramingError
Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
replaced by Error::source, which can support downcasting
Source§impl ErrorCompat for FramingError
impl ErrorCompat for FramingError
Source§fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
fn iter_chain(&self) -> ChainCompat<'_, '_>where
Self: AsErrorSource,
Error::source. Read moreSource§impl PartialEq for FramingError
impl PartialEq for FramingError
impl Eq for FramingError
impl StructuralPartialEq for FramingError
Auto Trait Implementations§
impl Freeze for FramingError
impl RefUnwindSafe for FramingError
impl Send for FramingError
impl Sync for FramingError
impl Unpin for FramingError
impl UnsafeUnpin for FramingError
impl UnwindSafe for FramingError
Blanket Implementations§
Source§impl<T> AsErrorSource for Twhere
T: Error + 'static,
impl<T> AsErrorSource for Twhere
T: Error + 'static,
Source§fn as_error_source(&self) -> &(dyn Error + 'static)
fn as_error_source(&self) -> &(dyn Error + 'static)
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::RequestSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Stringable for Twhere
T: Display,
impl<T> Stringable for Twhere
T: Display,
SharedString.Source§impl<T> Track for T
impl<T> Track for T
Source§fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
fn track_allocations(self, token: AllocationGroupToken) -> Tracked<Self>
Tracked wrapper. Read moreSource§fn in_current_allocation_group(self) -> Tracked<Self>
fn in_current_allocation_group(self) -> Tracked<Self>
Tracked wrapper. Read more