pub enum EncodeError {
InsufficientBuffer {
required: usize,
remaining: usize,
},
TooLarge,
Custom(Cow<'static, str>),
}Expand description
A data encoding error
Variants§
InsufficientBuffer
Returned when the encoded buffer is too small to hold the bytes format of the types.
TooLarge
Returned when the data in encoded format is larger than the maximum allowed size.
Custom(Cow<'static, str>)
A custom encoding error.
Implementations§
Source§impl EncodeError
impl EncodeError
Sourcepub const fn insufficient_buffer(
required: usize,
remaining: usize,
) -> EncodeError
pub const fn insufficient_buffer( required: usize, remaining: usize, ) -> EncodeError
Creates an insufficient buffer error.
Sourcepub fn custom<T>(value: T) -> EncodeError
pub fn custom<T>(value: T) -> EncodeError
Creates a custom encoding error.
Sourcepub fn update(self, required: usize, remaining: usize) -> EncodeError
pub fn update(self, required: usize, remaining: usize) -> EncodeError
Update the error with the required and remaining buffer capacity.
Trait Implementations§
Source§impl Debug for EncodeError
impl Debug for EncodeError
Source§impl Display for EncodeError
impl Display for EncodeError
Source§impl Error for EncodeError
impl Error for EncodeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<ConstEncodeError> for EncodeError
impl From<ConstEncodeError> for EncodeError
Source§fn from(value: ConstEncodeError) -> EncodeError
fn from(value: ConstEncodeError) -> EncodeError
Converts to this type from the input type.
Source§impl From<EncodeError> for EncodeError
impl From<EncodeError> for EncodeError
Source§fn from(value: EncodeError) -> EncodeError
fn from(value: EncodeError) -> EncodeError
Converts to this type from the input type.
Source§impl<T: Transport, D: Delegate> From<EncodeError> for Error<T, D>
impl<T: Transport, D: Delegate> From<EncodeError> for Error<T, D>
Source§fn from(source: EncodeError) -> Self
fn from(source: EncodeError) -> Self
Converts to this type from the input type.
Source§impl From<EncodeError> for ProtoEncoderError
impl From<EncodeError> for ProtoEncoderError
Source§fn from(source: EncodeError) -> ProtoEncoderError
fn from(source: EncodeError) -> ProtoEncoderError
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for EncodeError
impl RefUnwindSafe for EncodeError
impl Send for EncodeError
impl Sync for EncodeError
impl Unpin for EncodeError
impl UnwindSafe for EncodeError
Blanket Implementations§
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<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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more