[−][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.
Implementations
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 Debug for ComponentCreationError
[src]
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]
fn context<D>(self, context: D) -> Context<D> where
D: Display + Send + Sync + 'static,
[src]
D: Display + Send + Sync + 'static,
fn compat(self) -> Compat<Self>
[src]
impl From<ComponentCreationError> for MailError
[src]
fn from(err: ComponentCreationError) -> MailError
[src]
Auto Trait Implementations
impl !RefUnwindSafe for ComponentCreationError
impl Send for ComponentCreationError
impl Sync for ComponentCreationError
impl Unpin for ComponentCreationError
impl !UnwindSafe for ComponentCreationError
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsFail for T where
T: Fail,
[src]
T: Fail,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Erased for T
impl<E> Fail for E where
E: 'static + Error + Send + Sync,
[src]
E: 'static + Error + Send + Sync,
fn name(&self) -> Option<&str>
[src]
fn cause(&self) -> Option<&(dyn Fail + 'static)>
[src]
fn backtrace(&self) -> Option<&Backtrace>
[src]
fn context<D>(self, context: D) -> Context<D> where
D: Display + Send + Sync + 'static,
[src]
D: Display + Send + Sync + 'static,
fn compat(self) -> Compat<Self>
[src]
impl<T> From<T> for T
[src]
impl<T> HeaderTryFrom<T> for T
[src]
fn try_from(val: T) -> Result<T, ComponentCreationError>
[src]
impl<F, T> HeaderTryInto<T> for F where
T: HeaderTryFrom<F>,
[src]
T: HeaderTryFrom<F>,
fn try_into(self) -> Result<T, ComponentCreationError>
[src]
impl<T, U> Into<U> 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, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
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, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,