[−][src]Struct mail::error::ComponentCreationError
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.
Methods
impl ComponentCreationError
[src]
pub fn from_parent<P>(
parent: P,
component: &'static str
) -> ComponentCreationError where
P: Into<Error>,
[src]
parent: P,
component: &'static str
) -> ComponentCreationError where
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.
pub fn new(component: &'static str) -> ComponentCreationError
[src]
creates a new ComponentCreationError
based on the components name
The name is normally the type name, for example Email
, Mailbox
etc.
pub fn new_with_str<I>(
component: &'static str,
str_context: I
) -> ComponentCreationError where
I: Into<String>,
[src]
component: &'static str,
str_context: I
) -> ComponentCreationError where
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>
[src]
pub fn set_str_context<I>(&mut self, ctx: I) where
I: Into<String>,
[src]
I: Into<String>,
pub fn with_str_context<I>(self, ctx: I) -> ComponentCreationError where
I: Into<String>,
[src]
I: Into<String>,
Trait Implementations
impl Display for ComponentCreationError
[src]
impl Fail for ComponentCreationError
[src]
fn cause(&self) -> Option<&(dyn Fail + 'static)>
[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn name(&self) -> Option<&str>
[src]
Returns the "name" of the error. Read more
fn context<D>(self, context: D) -> Context<D> where
D: Display + Send + Sync + 'static,
[src]
D: Display + Send + Sync + 'static,
Provides context for this failure. Read more
fn compat(self) -> Compat<Self>
[src]
Wraps this failure in a compatibility wrapper that implements std::error::Error
. Read more
impl Debug for ComponentCreationError
[src]
impl From<ComponentCreationError> for MailError
[src]
fn from(err: ComponentCreationError) -> MailError
[src]
Auto Trait Implementations
impl Send for ComponentCreationError
impl Sync for ComponentCreationError
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T> From for T
[src]
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<E> Fail for E where
E: 'static + Error + Send + Sync,
[src]
E: 'static + Error + Send + Sync,
fn name(&self) -> Option<&str>
[src]
Returns the "name" of the error. Read more
fn cause(&self) -> Option<&(dyn Fail + 'static)>
[src]
Returns a reference to the underlying cause of this failure, if it is an error that wraps other errors. Read more
fn backtrace(&self) -> Option<&Backtrace>
[src]
Returns a reference to the Backtrace
carried by this failure, if it carries one. Read more
fn context<D>(self, context: D) -> Context<D> where
D: Display + Send + Sync + 'static,
[src]
D: Display + Send + Sync + 'static,
Provides context for this failure. Read more
fn compat(self) -> Compat<Self>
[src]
Wraps this failure in a compatibility wrapper that implements std::error::Error
. Read more
impl<T> AsFail for T where
T: Fail,
[src]
T: Fail,
impl<F, T> HeaderTryInto for F where
T: HeaderTryFrom<F>,
[src]
T: HeaderTryFrom<F>,