[][src]Struct mail_headers::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.

Methods

impl ComponentCreationError[src]

pub fn from_parent<P>(parent: P, component: &'static str) -> Self where
    P: Into<FError>, 
[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) -> Self[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) -> Self 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) -> Self where
    I: Into<String>, 
[src]

Trait Implementations

impl Debug for ComponentCreationError[src]

impl Display for ComponentCreationError[src]

impl Fail for ComponentCreationError[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]

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

Auto Trait Implementations

Blanket Implementations

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

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.

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

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

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]

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> Erased for T[src]