[][src]Struct soft_ascii_string::SoftAsciiString

pub struct SoftAsciiString(_);

a String wrapper with an additional "is us-ascii" soft constraint

Methods

impl SoftAsciiString[src]

pub fn from_unchecked<S: Into<String>>(s: S) -> Self[src]

pub fn from_string_unchecked<S: Into<String>>(s: S) -> Self[src]

Deprecated since 1.0.0:

use from_unchecked

pub fn from_string<S>(source: S) -> Result<Self, FromSourceError<S>> where
    S: Debug + AsRef<str> + Into<String>, 
[src]

pub fn new() -> Self[src]

pub fn with_capacity(cap: usize) -> Self[src]

pub fn revalidate_soft_constraint(self) -> Result<SoftAsciiString, String>[src]

pub fn inner_string_mut(&mut self) -> &mut String[src]

pub fn inner_string(&self) -> &String[src]

pub fn push_str(&mut self, other: &SoftAsciiStr)[src]

pub fn into_bytes(self) -> Vec<u8>[src]

pub fn push(&mut self, ch: SoftAsciiChar)[src]

pub fn pop(&mut self) -> Option<SoftAsciiChar>[src]

pub fn remove(&mut self, idx: usize) -> SoftAsciiChar[src]

pub fn insert(&mut self, idx: usize, ch: SoftAsciiChar)[src]

pub fn insert_str(&mut self, idx: usize, string: &SoftAsciiStr)[src]

pub fn as_soft_ascii_str(&self) -> &SoftAsciiStr[src]

pub fn as_soft_ascii_str_mut(&mut self) -> &mut SoftAsciiStr[src]

pub fn split_off(&mut self, at: usize) -> SoftAsciiString[src]

pub fn into_boxed_soft_ascii_str(self) -> Box<SoftAsciiStr>[src]

pub fn into_boxed_str(self) -> Box<str>[src]

pub fn is_ascii(&self) -> bool[src]

impl SoftAsciiString[src]

pub fn as_bytes(&self) -> &[u8][src]

pub fn capacity(&self) -> usize[src]

pub fn len(&self) -> usize[src]

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

pub fn is_empty(&self) -> bool[src]

impl SoftAsciiString[src]

pub fn reserve(&mut self, additional: usize)[src]

pub fn reserve_exact(&mut self, additional: usize)[src]

pub fn shrink_to_fit(&mut self)[src]

pub fn truncate(&mut self, new_len: usize)[src]

pub fn clear(&mut self)[src]

Methods from Deref<Target = SoftAsciiStr>

pub fn revalidate_soft_constraint(&self) -> Result<&Self, FromSourceError<&str>>[src]

reruns checks if the "is us-ascii" soft constraint is still valid

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

Important traits for SoftAsciiLines<'a>
pub fn lines(&self) -> SoftAsciiLines[src]

Important traits for SoftAsciiSplitWhitespace<'a>
pub fn split_whitespace(&self) -> SoftAsciiSplitWhitespace[src]

Important traits for SoftAsciiCharIndices<'a>
pub fn char_indices(&self) -> SoftAsciiCharIndices[src]

Important traits for SoftAsciiChars<'a>
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 inner_str_mut(&mut self) -> &mut str[src]

returns a mutable str reference to the inner buffer

Soft Constraint

be aware that it is very easy to introduce bugs when directly editing a SoftAsciiStr as an str. Still compared to a AsciiStr implementation this won't introduce unsafety, just possible brakeage of the soft constraint that the data should be ascii.

pub fn parse<F>(&self) -> Result<F, <F as FromStr>::Err> where
    F: FromStr
[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 AsRef<SoftAsciiStr> for SoftAsciiString[src]

impl AsRef<str> for SoftAsciiString[src]

impl AsRef<[u8]> for SoftAsciiString[src]

impl AsRef<OsStr> for SoftAsciiString[src]

impl AsRef<Path> for SoftAsciiString[src]

impl Into<Vec<u8>> for SoftAsciiString[src]

impl Into<String> for SoftAsciiString[src]

impl<'a> From<Cow<'a, SoftAsciiStr>> for SoftAsciiString[src]

impl<'a> From<&'a SoftAsciiStr> for SoftAsciiString[src]

impl From<Box<SoftAsciiStr>> for SoftAsciiString[src]

impl Extend<SoftAsciiChar> for SoftAsciiString[src]

impl<'a> Extend<&'a SoftAsciiChar> for SoftAsciiString[src]

impl Extend<SoftAsciiString> for SoftAsciiString[src]

impl<'a> Extend<&'a SoftAsciiStr> for SoftAsciiString[src]

impl<'a> Extend<Cow<'a, SoftAsciiStr>> for SoftAsciiString[src]

impl Clone for SoftAsciiString[src]

impl Default for SoftAsciiString[src]

impl Eq for SoftAsciiString[src]

impl Ord for SoftAsciiString[src]

impl PartialEq<SoftAsciiString> for SoftAsciiStr[src]

impl<'a> PartialEq<SoftAsciiString> for &'a SoftAsciiStr[src]

impl PartialEq<SoftAsciiString> for SoftAsciiString[src]

impl PartialEq<SoftAsciiString> for str[src]

impl<'a> PartialEq<&'a str> for SoftAsciiString[src]

impl<'a> PartialEq<SoftAsciiString> for &'a str[src]

impl PartialEq<str> for SoftAsciiString[src]

impl PartialEq<String> for SoftAsciiString[src]

impl PartialEq<SoftAsciiString> for String[src]

impl<'a> PartialEq<&'a SoftAsciiStr> for SoftAsciiString[src]

impl<'a> PartialEq<SoftAsciiString> for Cow<'a, str>[src]

impl<'a> PartialEq<Cow<'a, str>> for SoftAsciiString[src]

impl<'a> PartialEq<SoftAsciiString> for Cow<'a, SoftAsciiStr>[src]

impl<'a> PartialEq<Cow<'a, SoftAsciiStr>> for SoftAsciiString[src]

impl PartialOrd<SoftAsciiString> for SoftAsciiString[src]

impl Display for SoftAsciiString[src]

impl Debug for SoftAsciiString[src]

impl FromStr for SoftAsciiString[src]

type Err = StringFromStrError

The associated error which can be returned from parsing.

impl<'a> Add<&'a SoftAsciiStr> for SoftAsciiString[src]

type Output = Self

The resulting type after applying the + operator.

impl<'a> AddAssign<&'a SoftAsciiStr> for SoftAsciiString[src]

impl Deref for SoftAsciiString[src]

type Target = SoftAsciiStr

The resulting type after dereferencing.

impl DerefMut for SoftAsciiString[src]

impl Index<Range<usize>> for SoftAsciiString[src]

type Output = SoftAsciiStr

The returned type after indexing.

impl Index<RangeFrom<usize>> for SoftAsciiString[src]

type Output = SoftAsciiStr

The returned type after indexing.

impl Index<RangeTo<usize>> for SoftAsciiString[src]

type Output = SoftAsciiStr

The returned type after indexing.

impl Index<RangeFull> for SoftAsciiString[src]

type Output = SoftAsciiStr

The returned type after indexing.

impl IndexMut<Range<usize>> for SoftAsciiString[src]

impl IndexMut<RangeFrom<usize>> for SoftAsciiString[src]

impl IndexMut<RangeTo<usize>> for SoftAsciiString[src]

impl IndexMut<RangeFull> for SoftAsciiString[src]

impl Hash for SoftAsciiString[src]

impl FromIterator<SoftAsciiChar> for SoftAsciiString[src]

impl<'a> FromIterator<&'a SoftAsciiChar> for SoftAsciiString[src]

impl FromIterator<SoftAsciiString> for SoftAsciiString[src]

impl<'a> FromIterator<Cow<'a, SoftAsciiStr>> for SoftAsciiString[src]

impl<'a> FromIterator<&'a SoftAsciiStr> for SoftAsciiString[src]

impl Borrow<str> for SoftAsciiString[src]

impl Borrow<SoftAsciiStr> for SoftAsciiString[src]

impl ToSocketAddrs for SoftAsciiString[src]

type Iter = IntoIter<SocketAddr>

Returned iterator over socket addresses which this type may correspond to. Read more

Auto Trait Implementations

Blanket Implementations

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

impl<T> From<T> for T[src]

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

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> 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> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]