Struct mail::error::ComponentCreationError
source · pub struct ComponentCreationError { /* private fields */ }
Expand description
Creating a (header field) component from the given data failed
A good example converting a string to a mailbox by parsing it, or more concretely failing to do so because it’s not a valid mail address.
Implementations
sourceimpl ComponentCreationError
impl ComponentCreationError
sourcepub fn from_parent<P>(
parent: P,
component: &'static str
) -> ComponentCreationErrorwhere
P: Into<Error>,
pub fn from_parent<P>(
parent: P,
component: &'static str
) -> ComponentCreationErrorwhere
P: Into<Error>,
create a new ComponentCreationError
based on a different error and the name of the component
The name is normally the type name, for example Email
, Mailbox
etc.
sourcepub fn new(component: &'static str) -> ComponentCreationError
pub fn new(component: &'static str) -> ComponentCreationError
creates a new ComponentCreationError
based on the components name
The name is normally the type name, for example Email
, Mailbox
etc.
sourcepub fn new_with_str<I>(
component: &'static str,
str_context: I
) -> ComponentCreationErrorwhere
I: Into<String>,
pub fn new_with_str<I>(
component: &'static str,
str_context: I
) -> ComponentCreationErrorwhere
I: Into<String>,
creates a new ComponentCreationError
based on the components name with a str_context
The name is normally the type name, for example Email
, Mailbox
etc.
The str_context
is a snipped of text which can help a human to identify the
invalid parts, e.g. for parsing a email it could be the invalid email address.
pub fn str_context(&self) -> Option<&str>
pub fn set_str_context<I>(&mut self, ctx: I)where
I: Into<String>,
pub fn with_str_context<I>(self, ctx: I) -> ComponentCreationErrorwhere
I: Into<String>,
Trait Implementations
sourceimpl Debug for ComponentCreationError
impl Debug for ComponentCreationError
sourceimpl Display for ComponentCreationError
impl Display for ComponentCreationError
sourceimpl Fail for ComponentCreationError
impl Fail for ComponentCreationError
sourcefn cause(&self) -> Option<&(dyn Fail + 'static)>
fn cause(&self) -> Option<&(dyn Fail + 'static)>
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
Backtrace
carried by this failure, if it
carries one. Read moresourceimpl From<ComponentCreationError> for MailError
impl From<ComponentCreationError> for MailError
sourcefn from(err: ComponentCreationError) -> MailError
fn from(err: ComponentCreationError) -> MailError
Auto Trait Implementations
impl !RefUnwindSafe for ComponentCreationError
impl Send for ComponentCreationError
impl Sync for ComponentCreationError
impl Unpin for ComponentCreationError
impl !UnwindSafe for ComponentCreationError
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)
Self
into a dynamic trait object of Fail
.