Struct mail_headers::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) -> Selfwhere
P: Into<FError>,
pub fn from_parent<P>(parent: P, component: &'static str) -> Selfwhere
P: Into<FError>,
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) -> Self
pub fn new(component: &'static str) -> Self
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) -> Selfwhere
I: Into<String>,
pub fn new_with_str<I>(component: &'static str, str_context: I) -> Selfwhere
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) -> Selfwhere
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>
fn cause(&self) -> Option<&dyn Fail>
sourcefn backtrace(&self) -> Option<&Backtrace>
fn backtrace(&self) -> Option<&Backtrace>
Backtrace
carried by this failure, if it
carries one. Read more