[−][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\tlike 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 Clone for Phrase[src]
impl Debug for Phrase[src]
impl EncodableInHeader for Phrase[src]
fn encode(&self, heandle: &mut EncodingWriter) -> Result<(), EncodingError>[src]
fn boxed_clone(&self) -> Box<dyn EncodableInHeader>[src]
impl Eq 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,
impl<'a> HeaderTryFrom<&'a str> for Phrase[src]
fn try_from(input: &'a str) -> Result<Self, ComponentCreationError>[src]
impl HeaderTryFrom<Input> for Phrase[src]
fn try_from(input: Input) -> Result<Self, ComponentCreationError>[src]
impl HeaderTryFrom<String> for Phrase[src]
fn try_from(input: String) -> Result<Self, ComponentCreationError>[src]
impl PartialEq<Phrase> for Phrase[src]
impl StructuralEq for Phrase[src]
impl StructuralPartialEq for Phrase[src]
Auto Trait Implementations
impl RefUnwindSafe for Phrase
impl Send for Phrase
impl Sync for Phrase
impl Unpin for Phrase
impl UnwindSafe for Phrase
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
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[src]
impl<T> From<T> for T[src]
impl<T, U> Into<U> for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T[src]
fn clone_into(&self, target: &mut T)[src]
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>,