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
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§fn cause(&self) -> Option<&dyn Error>
fn cause(&self) -> Option<&dyn Error>
👎Deprecated since 1.33.0: 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,
Returns an iterator for traversing the chain of errors,
starting with the current error
and continuing with recursive calls to
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 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)
For maximum effectiveness, this needs to be called as a method
to benefit from Rust’s automatic dereferencing of method
receivers.
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
Mutably borrows from an owned value. Read more
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
Compare self to
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>
Wrap the input message
T
in a tonic::Request
Source§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,
Converts the given value to a
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>
Instruments this type by attaching the given allocation group token, returning a
Tracked
wrapper. Read moreSource§fn in_current_allocation_group(self) -> Tracked<Self>
fn in_current_allocation_group(self) -> Tracked<Self>
Instruments this type by attaching the current allocation group, returning a
Tracked
wrapper. Read more