[−][src]Enum mail_headers::data::InnerAscii
InnerAscii is string data container which can contain either a
owned SoftAsciiString
or a SoftAsciiStr
reference into a shared
string buffer.
Variants
Owned(SoftAsciiString)
Methods
impl InnerAscii
[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
Note that the underlying buffer is no an SoftAsciiString
but a
String
(from which we happend to know that it fulfills the "is
us-ascii" soft constraint). This allows us to have an InnerAscii
share data with a possible non us-ascii string buffer as long as
the part accessable through the SoftAsciiStr
is ascii. Or at last
should be ascii as it's a soft constraint.
impl InnerAscii
[src]
pub fn new<S: Into<SoftAsciiString>>(data: S) -> Self
[src]
impl InnerAscii
[src]
Methods from Deref<Target = SoftAsciiStr>
pub fn revalidate_soft_constraint(
&self
) -> Result<&SoftAsciiStr, FromSourceError<&str>>
[src]
&self
) -> Result<&SoftAsciiStr, FromSourceError<&str>>
reruns checks if the "is us-ascii" soft constraint is still valid
pub fn as_str(&self) -> &str
[src]
pub fn lines(&self) -> SoftAsciiLines
[src]
pub fn split_whitespace(&self) -> SoftAsciiSplitWhitespace
[src]
pub fn char_indices(&self) -> SoftAsciiCharIndices
[src]
pub fn chars(&self) -> SoftAsciiChars
[src]
pub fn split_at(&self, mid: usize) -> (&SoftAsciiStr, &SoftAsciiStr)
[src]
pub unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &SoftAsciiStr
[src]
pub fn parse<F>(&self) -> Result<F, <F as FromStr>::Err> where
F: FromStr,
[src]
F: FromStr,
pub fn to_lowercase(&self) -> SoftAsciiString
[src]
pub fn to_uppercase(&self) -> SoftAsciiString
[src]
pub fn repeat(&self, n: usize) -> SoftAsciiString
[src]
pub fn trim_right(&self) -> &SoftAsciiStr
[src]
pub fn trim_left(&self) -> &SoftAsciiStr
[src]
pub fn trim(&self) -> &SoftAsciiStr
[src]
pub fn len(&self) -> usize
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn is_char_boundary(&self, index: usize) -> bool
[src]
pub fn as_ptr(&self) -> *const u8
[src]
pub fn encode_utf16(&self) -> EncodeUtf16
[src]
pub fn is_ascii(&self) -> bool
[src]
pub fn as_bytes(&self) -> &[u8]
[src]
Trait Implementations
impl PartialEq<InnerAscii> for InnerAscii
[src]
fn eq(&self, other: &InnerAscii) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl AsRef<str> for InnerAscii
[src]
impl Clone for InnerAscii
[src]
fn clone(&self) -> InnerAscii
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl From<SoftAsciiString> for InnerAscii
[src]
fn from(data: SoftAsciiString) -> Self
[src]
impl Into<SoftAsciiString> for InnerAscii
[src]
fn into(self) -> SoftAsciiString
[src]
impl Eq for InnerAscii
[src]
impl Deref for InnerAscii
[src]
type Target = SoftAsciiStr
The resulting type after dereferencing.
fn deref(&self) -> &SoftAsciiStr
[src]
impl Hash for InnerAscii
[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 Debug for InnerAscii
[src]
Auto Trait Implementations
impl Send for InnerAscii
impl Sync for InnerAscii
Blanket Implementations
impl<T> From for T
[src]
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, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
try_from
)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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?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
try_from
)The type returned in the event of a conversion error.