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§
source§impl 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§
source§impl Debug for ComponentCreationError
impl Debug for ComponentCreationError
source§impl Display for ComponentCreationError
impl Display for ComponentCreationError
source§impl Fail for ComponentCreationError
impl Fail for ComponentCreationError
source§fn cause(&self) -> Option<&(dyn Fail + 'static)>
fn cause(&self) -> Option<&(dyn Fail + 'static)>
source§fn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
Backtrace
carried by this failure, if it
carries one. Read more