[][src]Struct mail_headers::header_components::Phrase

pub struct Phrase(pub Vec1<Word>);

Represent a "phrase" as it for example is used in the Mailbox type for the display name.

It is recommended to use the [Phrase.new()] constructor, which creates the right phrase for your input.

Warning: Details of this type, expect Phrase::new and Phrase::try_from, are likely to change with some of the coming braking changes. If you just create it using try_from or new changes should not affect you, but if you create it from a vec of Word's things might be different.

Methods

impl Phrase[src]

pub fn new<T: HeaderTryInto<Input>>(
    input: T
) -> Result<Self, ComponentCreationError>
[src]

Creates a Phrase instance from some arbitrary input.

This method can be used with both &str and String.

Error

There are only two cases in which this can fail:

  1. If the input is empty (a phrase can not be empty).
  2. If the input contained a illegal us-ascii character (any char which is not "visible" and not ' ' or \t like e.g. CTRL chars '\0' but also '\r' and '\n'). While we could encode them with encoded words, it's not really meant to be used this way and this chars will likely either be stripped out by a mail client or might cause display bugs.

Trait Implementations

impl<'a> HeaderTryFrom<&'a str> for Phrase[src]

impl HeaderTryFrom<String> for Phrase[src]

impl HeaderTryFrom<Input> for Phrase[src]

impl PartialEq<Phrase> for Phrase[src]

impl Clone for Phrase[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for Phrase[src]

impl Debug for Phrase[src]

impl Hash for Phrase[src]

fn hash_slice<H>(data: &[Self], state: &mut H) where
    H: Hasher
1.3.0
[src]

Feeds a slice of this type into the given [Hasher]. Read more

impl EncodableInHeader for Phrase[src]

Auto Trait Implementations

impl Send for Phrase

impl Sync for Phrase

Blanket Implementations

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

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[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> 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> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Erased for T[src]