Struct soft_ascii_string::SoftAsciiString
[−]
[src]
pub struct SoftAsciiString(_);
a String
wrapper with an additional "is us-ascii" soft constraint
Methods
impl SoftAsciiString
[src]
fn from_string_unchecked<S: Into<String>>(s: S) -> Self
[src]
fn from_string<S>(source: S) -> Result<Self, FromSourceError<S>> where
S: Debug + AsRef<str> + Into<String>,
[src]
S: Debug + AsRef<str> + Into<String>,
fn new() -> Self
[src]
fn with_capacity(cap: usize) -> Self
[src]
fn revalidate_soft_constraint(self) -> Result<SoftAsciiString, String>
[src]
fn inner_string_mut(&mut self) -> &mut String
[src]
fn inner_string(&self) -> &String
[src]
fn push_str(&mut self, other: &SoftAsciiStr)
[src]
fn into_bytes(self) -> Vec<u8>
[src]
fn push(&mut self, ch: SoftAsciiChar)
[src]
fn pop(&mut self) -> Option<SoftAsciiChar>
[src]
fn remove(&mut self, idx: usize) -> SoftAsciiChar
[src]
fn insert(&mut self, idx: usize, ch: SoftAsciiChar)
[src]
fn insert_str(&mut self, idx: usize, string: &SoftAsciiStr)
[src]
fn as_soft_ascii_str(&self) -> &SoftAsciiStr
[src]
fn as_soft_ascii_str_mut(&mut self) -> &mut SoftAsciiStr
[src]
fn split_off(&mut self, at: usize) -> SoftAsciiString
[src]
fn into_boxed_soft_ascii_str(self) -> Box<SoftAsciiStr>
[src]
fn into_boxed_str(self) -> Box<str>
[src]
fn is_ascii(&self) -> bool
[src]
impl SoftAsciiString
[src]
fn as_bytes(&self) -> &[u8]
[src]
fn capacity(&self) -> usize
[src]
fn len(&self) -> usize
[src]
fn as_str(&self) -> &str
[src]
fn is_empty(&self) -> bool
[src]
impl SoftAsciiString
[src]
fn reserve(&mut self, additional: usize)
[src]
fn reserve_exact(&mut self, additional: usize)
[src]
fn shrink_to_fit(&mut self)
[src]
fn truncate(&mut self, new_len: usize)
[src]
fn clear(&mut self)
[src]
Methods from Deref<Target = SoftAsciiStr>
fn revalidate_soft_constraint(&self) -> Result<&Self, FromSourceError<&str>>
[src]
reruns checks if the "is us-ascii" soft constraint is still valid
fn as_str(&self) -> &str
[src]
fn lines(&self) -> SoftAsciiLines
[src]
fn split_whitespace(&self) -> SoftAsciiSplitWhitespace
[src]
fn char_indices(&self) -> SoftAsciiCharIndices
[src]
fn chars(&self) -> SoftAsciiChars
[src]
fn split_at(&self, mid: usize) -> (&SoftAsciiStr, &SoftAsciiStr)
[src]
unsafe fn slice_unchecked(&self, begin: usize, end: usize) -> &SoftAsciiStr
[src]
fn inner_str_mut(&mut self) -> &mut str
[src]
returns a mutable str
reference to the inner buffer
Soft Constriant
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 brakage of the
soft constraint that the data should be ascii.
fn parse<F>(&self) -> Result<F, <F as FromStr>::Err> where
F: FromStr,
[src]
F: FromStr,
fn to_lowercase(&self) -> SoftAsciiString
[src]
fn to_uppercase(&self) -> SoftAsciiString
[src]
fn repeat(&self, n: usize) -> SoftAsciiString
[src]
fn trim_right(&self) -> &SoftAsciiStr
[src]
fn trim_left(&self) -> &SoftAsciiStr
[src]
fn trim(&self) -> &SoftAsciiStr
[src]
fn len(&self) -> usize
[src]
fn is_empty(&self) -> bool
[src]
fn is_char_boundary(&self, index: usize) -> bool
[src]
fn as_ptr(&self) -> *const u8
[src]
fn encode_utf16(&self) -> EncodeUtf16
[src]
fn is_ascii(&self) -> bool
[src]
fn as_bytes(&self) -> &[u8]
[src]
Trait Implementations
impl Debug for SoftAsciiString
[src]
impl Clone for SoftAsciiString
[src]
fn clone(&self) -> SoftAsciiString
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for SoftAsciiString
[src]
fn eq(&self, __arg_0: &SoftAsciiString) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &SoftAsciiString) -> bool
[src]
This method tests for !=
.
impl Eq for SoftAsciiString
[src]
impl PartialOrd for SoftAsciiString
[src]
fn partial_cmp(&self, __arg_0: &SoftAsciiString) -> Option<Ordering>
[src]
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, __arg_0: &SoftAsciiString) -> bool
[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, __arg_0: &SoftAsciiString) -> bool
[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, __arg_0: &SoftAsciiString) -> bool
[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, __arg_0: &SoftAsciiString) -> bool
[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Ord for SoftAsciiString
[src]
fn cmp(&self, __arg_0: &SoftAsciiString) -> Ordering
[src]
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.22.0[src]
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.22.0[src]
Compares and returns the minimum of two values. Read more
impl Hash for SoftAsciiString
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
[src]
Feeds this value into the given [Hasher
]. Read more
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 Default for SoftAsciiString
[src]
fn default() -> SoftAsciiString
[src]
Returns the "default value" for a type. Read more
impl Borrow<str> for SoftAsciiString
[src]
impl Borrow<SoftAsciiStr> for SoftAsciiString
[src]
fn borrow(&self) -> &SoftAsciiStr
[src]
Immutably borrows from an owned value. Read more
impl Deref for SoftAsciiString
[src]
type Target = SoftAsciiStr
The resulting type after dereferencing.
fn deref(&self) -> &Self::Target
[src]
Dereferences the value.
impl DerefMut for SoftAsciiString
[src]
impl<'a> AddAssign<&'a SoftAsciiStr> for SoftAsciiString
[src]
fn add_assign(&mut self, other: &'a SoftAsciiStr)
[src]
Performs the +=
operation.
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]
Performs the +
operation.
impl<'a> PartialEq<&'a str> for SoftAsciiString
[src]
fn eq(&self, other: &&'a str) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<str> for SoftAsciiString
[src]
fn eq(&self, other: &str) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl PartialEq<String> for SoftAsciiString
[src]
fn eq(&self, other: &String) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a> PartialEq<&'a SoftAsciiStr> for SoftAsciiString
[src]
fn eq(&self, other: &&'a SoftAsciiStr) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a> PartialEq<Cow<'a, str>> for SoftAsciiString
[src]
fn eq(&self, other: &Cow<'a, str>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a> PartialEq<Cow<'a, SoftAsciiStr>> for SoftAsciiString
[src]
fn eq(&self, other: &Cow<'a, SoftAsciiStr>) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl FromIterator<SoftAsciiChar> for SoftAsciiString
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = SoftAsciiChar>,
[src]
I: IntoIterator<Item = SoftAsciiChar>,
Creates a value from an iterator. Read more
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>,
Creates a value from an iterator. Read more
impl FromIterator<SoftAsciiString> for SoftAsciiString
[src]
fn from_iter<I>(iter: I) -> Self where
I: IntoIterator<Item = SoftAsciiString>,
[src]
I: IntoIterator<Item = SoftAsciiString>,
Creates a value from an iterator. Read more
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>>,
Creates a value from an iterator. Read more
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>,
Creates a value from an iterator. Read more
impl AsRef<SoftAsciiStr> for SoftAsciiString
[src]
fn as_ref(&self) -> &SoftAsciiStr
[src]
Performs the conversion.
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 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]
Converts this object to an iterator of resolved SocketAddr
s. Read more
impl Index<Range<usize>> for SoftAsciiString
[src]
type Output = SoftAsciiStr
The returned type after indexing.
fn index(&self, index: Range<usize>) -> &Self::Output
[src]
Performs the indexing (container[index]
) operation.
impl Index<RangeFrom<usize>> for SoftAsciiString
[src]
type Output = SoftAsciiStr
The returned type after indexing.
fn index(&self, index: RangeFrom<usize>) -> &Self::Output
[src]
Performs the indexing (container[index]
) operation.
impl Index<RangeTo<usize>> for SoftAsciiString
[src]
type Output = SoftAsciiStr
The returned type after indexing.
fn index(&self, index: RangeTo<usize>) -> &Self::Output
[src]
Performs the indexing (container[index]
) operation.
impl Index<RangeFull> for SoftAsciiString
[src]
type Output = SoftAsciiStr
The returned type after indexing.
fn index(&self, index: RangeFull) -> &Self::Output
[src]
Performs the indexing (container[index]
) operation.
impl IndexMut<Range<usize>> for SoftAsciiString
[src]
fn index_mut(&mut self, index: Range<usize>) -> &mut Self::Output
[src]
Performs the mutable indexing (container[index]
) operation.
impl IndexMut<RangeFrom<usize>> for SoftAsciiString
[src]
fn index_mut(&mut self, index: RangeFrom<usize>) -> &mut Self::Output
[src]
Performs the mutable indexing (container[index]
) operation.
impl IndexMut<RangeTo<usize>> for SoftAsciiString
[src]
fn index_mut(&mut self, index: RangeTo<usize>) -> &mut Self::Output
[src]
Performs the mutable indexing (container[index]
) operation.
impl IndexMut<RangeFull> for SoftAsciiString
[src]
fn index_mut(&mut self, index: RangeFull) -> &mut Self::Output
[src]
Performs the mutable indexing (container[index]
) operation.
impl Extend<SoftAsciiChar> for SoftAsciiString
[src]
fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = SoftAsciiChar>,
[src]
I: IntoIterator<Item = SoftAsciiChar>,
Extends a collection with the contents of an iterator. Read more
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>,
Extends a collection with the contents of an iterator. Read more
impl Extend<SoftAsciiString> for SoftAsciiString
[src]
fn extend<I>(&mut self, iter: I) where
I: IntoIterator<Item = SoftAsciiString>,
[src]
I: IntoIterator<Item = SoftAsciiString>,
Extends a collection with the contents of an iterator. Read more
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>,
Extends a collection with the contents of an iterator. Read more
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>>,
Extends a collection with the contents of an iterator. Read more
impl<'a> From<Cow<'a, SoftAsciiStr>> for SoftAsciiString
[src]
fn from(cow: Cow<'a, SoftAsciiStr>) -> Self
[src]
Performs the conversion.
impl<'a> From<&'a SoftAsciiStr> for SoftAsciiString
[src]
fn from(s: &'a SoftAsciiStr) -> Self
[src]
Performs the conversion.
impl From<Box<SoftAsciiStr>> for SoftAsciiString
[src]
fn from(b: Box<SoftAsciiStr>) -> SoftAsciiString
[src]
Performs the conversion.
impl Display for SoftAsciiString
[src]
fn fmt(&self, fter: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more