[][src]Enum mail_headers::data::InnerUtf8

pub enum InnerUtf8 {
    Owned(String),
    Shared(OwningRef<Arc<String>, str>),
}

InnerUtf8 is string data container which can contain either a owned String or a str reference into a shared string buffer.

Variants

Owned(String)Shared(OwningRef<Arc<String>, str>)

Methods

impl InnerUtf8[src]

pub fn into_shared(self) -> Self[src]

converts this container into on which uses underlying shared data

if the data is already shared nothing is done. If not the owned data is converted into the underlying string buffer and OwningRef is used to enable the shared reference

impl InnerUtf8[src]

pub fn new<S: Into<String>>(data: S) -> Self[src]

impl InnerUtf8[src]

pub fn as_str(&self) -> &str[src]

Trait Implementations

impl From<String> for InnerUtf8[src]

impl Eq for InnerUtf8[src]

impl Into<String> for InnerUtf8[src]

impl AsRef<str> for InnerUtf8[src]

impl PartialEq<InnerUtf8> for InnerUtf8[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Clone for InnerUtf8[src]

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

Performs copy-assignment from source. Read more

impl Debug for InnerUtf8[src]

impl Hash for InnerUtf8[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 Deref for InnerUtf8[src]

type Target = str

The resulting type after dereferencing.

impl Serialize for InnerUtf8[src]

impl<'de> Deserialize<'de> for InnerUtf8[src]

Auto Trait Implementations

impl Send for InnerUtf8

impl Sync for InnerUtf8

Blanket Implementations

impl<T> From for T[src]

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

impl<T> DeserializeOwned for T where
    T: Deserialize<'de>, 
[src]