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,
) -> ComponentCreationError
pub fn from_parent<P>( parent: P, component: &'static str, ) -> ComponentCreationError
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,
) -> ComponentCreationError
pub fn new_with_str<I>( component: &'static str, str_context: I, ) -> ComponentCreationError
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)
pub fn with_str_context<I>(self, ctx: I) -> ComponentCreationError
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