[−][src]Struct soft_ascii_string::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]
use from_unchecked
pub fn from_string<S>(source: S) -> Result<Self, FromSourceError<S>> where
S: Debug + AsRef<str> + Into<String>,
[src]
S: Debug + AsRef<str> + Into<String>,
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]
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 AsRef<SoftAsciiStr> for SoftAsciiString
[src]
fn as_ref(&self) -> &SoftAsciiStr
[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]
fn from(cow: Cow<'a, SoftAsciiStr>) -> Self
[src]
impl<'a> From<&'a SoftAsciiStr> for SoftAsciiString
[src]
fn from(s: &'a SoftAsciiStr) -> Self
[src]
impl From<Box<SoftAsciiStr>> for SoftAsciiString
[src]
fn from(b: Box<SoftAsciiStr>) -> SoftAsciiString
[src]
impl Extend<SoftAsciiChar> for SoftAsciiString
[src]
fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = SoftAsciiChar>,
[src]
I: IntoIterator<Item = SoftAsciiChar>,
impl<'a> Extend<&'a SoftAsciiChar> for SoftAsciiString
[src]
fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = &'a SoftAsciiChar>,
[src]
I: IntoIterator<Item = &'a SoftAsciiChar>,
impl Extend<SoftAsciiString> for SoftAsciiString
[src]
fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = SoftAsciiString>,
[src]
I: IntoIterator<Item = SoftAsciiString>,
impl<'a> Extend<&'a SoftAsciiStr> for SoftAsciiString
[src]
fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = &'a SoftAsciiStr>,
[src]
I: IntoIterator<Item = &'a SoftAsciiStr>,
impl<'a> Extend<Cow<'a, SoftAsciiStr>> for SoftAsciiString
[src]
fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = Cow<'a, SoftAsciiStr>>,
[src]
I: IntoIterator<Item = Cow<'a, SoftAsciiStr>>,
impl Clone for SoftAsciiString
[src]
fn clone(&self) -> SoftAsciiString
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Default for SoftAsciiString
[src]
fn default() -> SoftAsciiString
[src]
impl Eq for SoftAsciiString
[src]
impl Ord for SoftAsciiString
[src]
fn cmp(&self, other: &SoftAsciiString) -> Ordering
[src]
fn max(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
1.21.0[src]
fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<SoftAsciiString> for SoftAsciiStr
[src]
fn eq(&self, other: &SoftAsciiString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialEq<SoftAsciiString> for &'a SoftAsciiStr
[src]
fn eq(&self, other: &SoftAsciiString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<SoftAsciiString> for SoftAsciiString
[src]
fn eq(&self, other: &SoftAsciiString) -> bool
[src]
fn ne(&self, other: &SoftAsciiString) -> bool
[src]
impl PartialEq<SoftAsciiString> for str
[src]
fn eq(&self, other: &SoftAsciiString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialEq<&'a str> for SoftAsciiString
[src]
impl<'a> PartialEq<SoftAsciiString> for &'a str
[src]
fn eq(&self, other: &SoftAsciiString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<str> for SoftAsciiString
[src]
impl PartialEq<String> for SoftAsciiString
[src]
impl PartialEq<SoftAsciiString> for String
[src]
fn eq(&self, other: &SoftAsciiString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialEq<&'a SoftAsciiStr> for SoftAsciiString
[src]
fn eq(&self, other: &&'a SoftAsciiStr) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialEq<SoftAsciiString> for Cow<'a, str>
[src]
fn eq(&self, other: &SoftAsciiString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialEq<Cow<'a, str>> for SoftAsciiString
[src]
fn eq(&self, other: &Cow<'a, str>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialEq<SoftAsciiString> for Cow<'a, SoftAsciiStr>
[src]
fn eq(&self, other: &SoftAsciiString) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialEq<Cow<'a, SoftAsciiStr>> for SoftAsciiString
[src]
fn eq(&self, other: &Cow<'a, SoftAsciiStr>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<SoftAsciiString> for SoftAsciiString
[src]
fn partial_cmp(&self, other: &SoftAsciiString) -> Option<Ordering>
[src]
fn lt(&self, other: &SoftAsciiString) -> bool
[src]
fn le(&self, other: &SoftAsciiString) -> bool
[src]
fn gt(&self, other: &SoftAsciiString) -> bool
[src]
fn ge(&self, other: &SoftAsciiString) -> bool
[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.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
impl<'a> Add<&'a SoftAsciiStr> for SoftAsciiString
[src]
type Output = Self
The resulting type after applying the +
operator.
fn add(self, other: &'a SoftAsciiStr) -> Self
[src]
impl<'a> AddAssign<&'a SoftAsciiStr> for SoftAsciiString
[src]
fn add_assign(&mut self, other: &'a SoftAsciiStr)
[src]
impl Deref for SoftAsciiString
[src]
type Target = SoftAsciiStr
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
impl DerefMut for SoftAsciiString
[src]
impl Index<Range<usize>> for SoftAsciiString
[src]
type Output = SoftAsciiStr
The returned type after indexing.
fn index(&self, index: Range<usize>) -> &Self::Output
[src]
impl Index<RangeFrom<usize>> for SoftAsciiString
[src]
type Output = SoftAsciiStr
The returned type after indexing.
fn index(&self, index: RangeFrom<usize>) -> &Self::Output
[src]
impl Index<RangeTo<usize>> for SoftAsciiString
[src]
type Output = SoftAsciiStr
The returned type after indexing.
fn index(&self, index: RangeTo<usize>) -> &Self::Output
[src]
impl Index<RangeFull> for SoftAsciiString
[src]
type Output = SoftAsciiStr
The returned type after indexing.
fn index(&self, index: RangeFull) -> &Self::Output
[src]
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]
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 FromIterator<SoftAsciiChar> for SoftAsciiString
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = SoftAsciiChar>,
[src]
I: IntoIterator<Item = SoftAsciiChar>,
impl<'a> FromIterator<&'a SoftAsciiChar> for SoftAsciiString
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = &'a SoftAsciiChar>,
[src]
I: IntoIterator<Item = &'a SoftAsciiChar>,
impl FromIterator<SoftAsciiString> for SoftAsciiString
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = SoftAsciiString>,
[src]
I: IntoIterator<Item = SoftAsciiString>,
impl<'a> FromIterator<Cow<'a, SoftAsciiStr>> for SoftAsciiString
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = Cow<'a, SoftAsciiStr>>,
[src]
I: IntoIterator<Item = Cow<'a, SoftAsciiStr>>,
impl<'a> FromIterator<&'a SoftAsciiStr> for SoftAsciiString
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = &'a SoftAsciiStr>,
[src]
I: IntoIterator<Item = &'a SoftAsciiStr>,
impl Borrow<str> for SoftAsciiString
[src]
impl Borrow<SoftAsciiStr> for SoftAsciiString
[src]
fn borrow(&self) -> &SoftAsciiStr
[src]
impl ToSocketAddrs for SoftAsciiString
[src]
type Iter = IntoIter<SocketAddr>
Returned iterator over socket addresses which this type may correspond to. Read more
fn to_socket_addrs(&self) -> Result<IntoIter<SocketAddr>>
[src]
Auto Trait Implementations
impl Send for SoftAsciiString
impl Sync for SoftAsciiString
impl Unpin for SoftAsciiString
impl UnwindSafe for SoftAsciiString
impl RefUnwindSafe for SoftAsciiString
Blanket Implementations
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> From<T> for T
[src]
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,
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> 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> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,