[][src]Struct mail::error::ComponentCreationError

pub struct ComponentCreationError { /* fields omitted */ }

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

impl ComponentCreationError[src]

pub fn from_parent<P>(
    parent: P,
    component: &'static str
) -> ComponentCreationError where
    P: Into<Error>, 
[src]

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]

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]

pub fn with_str_context<I>(self, ctx: I) -> ComponentCreationError where
    I: Into<String>, 
[src]

Trait Implementations

impl Debug for ComponentCreationError[src]

impl Display for ComponentCreationError[src]

impl Fail for ComponentCreationError[src]

impl From<ComponentCreationError> for MailError[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> AsFail for T where
    T: Fail
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Erased for T

impl<E> Fail for E where
    E: 'static + Error + Send + Sync
[src]

impl<T> From<T> for T[src]

impl<T> HeaderTryFrom<T> for T[src]

impl<F, T> HeaderTryInto<T> for F where
    T: HeaderTryFrom<F>, 
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.