Struct mail_internals::error::EncodingError
source · 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
sourceimpl 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)where
I: Into<String>,
pub fn set_str_context<I>(&mut self, ctx: I)where
I: Into<String>,
Sets the str context.
sourcepub fn with_str_context<I>(self, ctx: I) -> Selfwhere
I: Into<String>,
pub fn with_str_context<I>(self, ctx: I) -> Selfwhere
I: Into<String>,
Returns a version of self which has a str context like the given one.
sourcepub fn with_place_or_else<F>(self, func: F) -> Selfwhere
F: FnOnce() -> Option<Place>,
pub fn with_place_or_else<F>(self, func: F) -> Selfwhere
F: FnOnce() -> Option<Place>,
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) -> Selfwhere
F: FnOnce() -> Option<MailType>,
pub fn with_mail_type_or_else<F>(self, func: F) -> Selfwhere
F: FnOnce() -> Option<MailType>,
Adds a mail type (context) to self if there isn’t one and returns self.
Trait Implementations
sourceimpl Debug for EncodingError
impl Debug for EncodingError
sourceimpl Display for EncodingError
impl Display for EncodingError
sourceimpl Fail for EncodingError
impl Fail for EncodingError
sourcefn 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
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
Returns a reference to the
Backtrace
carried by this failure, if it
carries one. Read moresourceimpl From<(Context<EncodingErrorKind>, MailType)> for EncodingError
impl From<(Context<EncodingErrorKind>, MailType)> for EncodingError
sourcefn from((inner, mail_type): (Context<EncodingErrorKind>, MailType)) -> Self
fn from((inner, mail_type): (Context<EncodingErrorKind>, MailType)) -> Self
Converts to this type from the input type.
sourceimpl From<(EncodingErrorKind, MailType)> for EncodingError
impl From<(EncodingErrorKind, MailType)> for EncodingError
sourcefn from((ctx, mail_type): (EncodingErrorKind, MailType)) -> Self
fn from((ctx, mail_type): (EncodingErrorKind, MailType)) -> Self
Converts to this type from the input type.
sourceimpl From<Context<EncodingErrorKind>> for EncodingError
impl From<Context<EncodingErrorKind>> for EncodingError
sourcefn from(inner: Context<EncodingErrorKind>) -> Self
fn from(inner: Context<EncodingErrorKind>) -> Self
Converts to this type from the input type.
sourceimpl From<EncodingErrorKind> for EncodingError
impl From<EncodingErrorKind> for EncodingError
sourcefn from(ctx: EncodingErrorKind) -> Self
fn from(ctx: EncodingErrorKind) -> Self
Converts to this type from the input type.
Auto Trait Implementations
impl !RefUnwindSafe for EncodingError
impl Send for EncodingError
impl Sync for EncodingError
impl Unpin for EncodingError
impl !UnwindSafe for EncodingError
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more