pub struct EncodingError { /* private fields */ }
Expand description
A general error appearing when encoding failed in some way.
This error consists of an EncodingErrorKind
and a bit
of contextual information including: The place the error
happened in (Header { name }
,Body
), a string representing
the context when it happens (e.g. the word which could not be encoded),
and the mail type.
Implementations§
Source§impl EncodingError
impl EncodingError
Sourcepub fn kind(&self) -> EncodingErrorKind
pub fn kind(&self) -> EncodingErrorKind
Return the error kind.
Sourcepub fn str_context(&self) -> Option<&str>
pub fn str_context(&self) -> Option<&str>
Returns the str_context associated with the error.
Sourcepub fn set_str_context<I>(&mut self, ctx: I)
pub fn set_str_context<I>(&mut self, ctx: I)
Sets the str context.
Sourcepub fn with_str_context<I>(self, ctx: I) -> Self
pub fn with_str_context<I>(self, ctx: I) -> Self
Returns a version of self which has a str context like the given one.
Sourcepub fn with_place_or_else<F>(self, func: F) -> Self
pub fn with_place_or_else<F>(self, func: F) -> Self
Adds a place (context) to self if there isn’t one and returns self.
Sourcepub fn with_mail_type_or_else<F>(self, func: F) -> Self
pub fn with_mail_type_or_else<F>(self, func: F) -> Self
Adds a mail type (context) to self if there isn’t one and returns self.
Trait Implementations§
Source§impl Debug for EncodingError
impl Debug for EncodingError
Source§impl Display for EncodingError
impl Display for EncodingError
Source§impl Fail for EncodingError
impl Fail for EncodingError
Source§fn cause(&self) -> Option<&dyn Fail>
fn cause(&self) -> Option<&dyn Fail>
Returns a reference to the underlying cause of this failure, if it
is an error that wraps other errors. Read more
Source§fn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
Returns a reference to the
Backtrace
carried by this failure, if it
carries one. Read moreSource§impl From<(Context<EncodingErrorKind>, MailType)> for EncodingError
impl From<(Context<EncodingErrorKind>, MailType)> for EncodingError
Source§impl From<(EncodingErrorKind, MailType)> for EncodingError
impl From<(EncodingErrorKind, MailType)> for EncodingError
Source§fn from((ctx, mail_type): (EncodingErrorKind, MailType)) -> Self
fn from((ctx, mail_type): (EncodingErrorKind, MailType)) -> Self
Converts to this type from the input type.
Source§impl From<Context<EncodingErrorKind>> for EncodingError
impl From<Context<EncodingErrorKind>> for EncodingError
Source§fn from(inner: Context<EncodingErrorKind>) -> Self
fn from(inner: Context<EncodingErrorKind>) -> Self
Converts to this type from the input type.
Source§impl From<EncodingErrorKind> for EncodingError
impl From<EncodingErrorKind> for EncodingError
Source§fn from(ctx: EncodingErrorKind) -> Self
fn from(ctx: EncodingErrorKind) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for EncodingError
impl !RefUnwindSafe for EncodingError
impl Send for EncodingError
impl Sync for EncodingError
impl Unpin for EncodingError
impl !UnwindSafe for EncodingError
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