pub struct CodecError {
pub kind: CodecErrorKind,
/* private fields */
}Fields§
§kind: CodecErrorKindImplementations§
Source§impl CodecError
impl CodecError
pub const fn kind(&self) -> CodecErrorKind
pub const fn codec(&self) -> CodecKind
pub fn context(&self) -> Option<CodecKind>
pub fn contexts(&self) -> &[CodecKind]
pub const fn operation(&self) -> CodecOperation
Sourcepub const fn bytes_processed(&self) -> usize
pub const fn bytes_processed(&self) -> usize
Returns the number of bytes successfully processed before the error.
pub fn io_error(&self) -> Option<&Error>
Sourcepub fn with_context(self, context: CodecKind) -> Self
pub fn with_context(self, context: CodecKind) -> Self
Adds the outer codec that was active when this error occurred.
pub fn from_read_error( codec: CodecKind, bytes_processed: usize, source: Error, ) -> Self
pub fn from_write_error( codec: CodecKind, bytes_processed: usize, source: Error, ) -> Self
Sourcepub const fn invalid_encoding(
codec: CodecKind,
bytes_processed: usize,
reason: InvalidEncodingReason,
) -> Self
pub const fn invalid_encoding( codec: CodecKind, bytes_processed: usize, reason: InvalidEncodingReason, ) -> Self
Tips:encoding是编码格式,不是encode过程
pub const fn invalid_encoding_for_operation( codec: CodecKind, operation: CodecOperation, bytes_processed: usize, reason: InvalidEncodingReason, ) -> Self
pub fn invalid_encoding_for_operation_with_source( codec: CodecKind, operation: CodecOperation, bytes_processed: usize, reason: InvalidEncodingReason, source: impl Error + Send + Sync + 'static, ) -> Self
Trait Implementations§
Source§impl Debug for CodecError
impl Debug for CodecError
Source§impl Display for CodecError
impl Display for CodecError
Source§impl Error for CodecError
impl Error for CodecError
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()
Auto Trait Implementations§
impl !RefUnwindSafe for CodecError
impl !UnwindSafe for CodecError
impl Freeze for CodecError
impl Send for CodecError
impl Sync for CodecError
impl Unpin for CodecError
impl UnsafeUnpin for CodecError
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