[−][src]Struct mail_headers::header_components::Phrase
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]
input: T
) -> Result<Self, ComponentCreationError>
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:
- If the input is empty (a phrase can not be empty).
- 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]
fn try_from(input: &'a str) -> Result<Self, ComponentCreationError>
[src]
impl HeaderTryFrom<String> for Phrase
[src]
fn try_from(input: String) -> Result<Self, ComponentCreationError>
[src]
impl HeaderTryFrom<Input> for Phrase
[src]
fn try_from(input: Input) -> Result<Self, ComponentCreationError>
[src]
impl PartialEq<Phrase> for Phrase
[src]
impl Clone for Phrase
[src]
fn clone(&self) -> 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<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl EncodableInHeader for Phrase
[src]
fn encode(&self, heandle: &mut EncodingWriter) -> Result<(), EncodingError>
[src]
fn boxed_clone(&self) -> Box<dyn EncodableInHeader>
[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> TryFrom 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> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
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,