Struct mail::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) -> EncodingErrorwhere
    I: Into<String>,
 
pub fn with_str_context<I>(self, ctx: I) -> EncodingErrorwhere
    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) -> EncodingErrorwhere
    F: FnOnce() -> Option<Place>,
 
pub fn with_place_or_else<F>(self, func: F) -> EncodingErrorwhere
    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) -> EncodingErrorwhere
    F: FnOnce() -> Option<MailType>,
 
pub fn with_mail_type_or_else<F>(self, func: F) -> EncodingErrorwhere
    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 + 'static)>
 
fn cause(&self) -> Option<&(dyn Fail + 'static)>
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(_: (Context<EncodingErrorKind>, MailType)) -> EncodingError
 
fn from(_: (Context<EncodingErrorKind>, MailType)) -> EncodingError
Converts to this type from the input type.
sourceimpl From<(EncodingErrorKind, MailType)> for EncodingError
 
impl From<(EncodingErrorKind, MailType)> for EncodingError
sourcefn from(_: (EncodingErrorKind, MailType)) -> EncodingError
 
fn from(_: (EncodingErrorKind, MailType)) -> EncodingError
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>) -> EncodingError
 
fn from(inner: Context<EncodingErrorKind>) -> EncodingError
Converts to this type from the input type.
sourceimpl From<EncodingError> for MailError
 
impl From<EncodingError> for MailError
sourcefn from(err: EncodingError) -> MailError
 
fn from(err: EncodingError) -> MailError
Converts to this type from the input type.
sourceimpl From<EncodingError> for ResourceError
 
impl From<EncodingError> for ResourceError
sourcefn from(err: EncodingError) -> ResourceError
 
fn from(err: EncodingError) -> ResourceError
Converts to this type from the input type.
sourceimpl From<EncodingErrorKind> for EncodingError
 
impl From<EncodingErrorKind> for EncodingError
sourcefn from(ctx: EncodingErrorKind) -> EncodingError
 
fn from(ctx: EncodingErrorKind) -> EncodingError
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
impl<T> AsFail for Twhere
    T: Fail,
impl<T> AsFail for Twhere
    T: Fail,
fn as_fail(&self) -> &(dyn Fail + 'static)
fn as_fail(&self) -> &(dyn Fail + 'static)
Converts a reference to 
Self into a dynamic trait object of Fail.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