pub type StrMut = StrInner<BytesMut>;
Expand description
Aliased Type§
struct StrMut(/* private fields */);
Implementations§
Source§impl StrMut
impl StrMut
Sourcepub fn split_built(&mut self) -> StrMut
pub fn split_built(&mut self) -> StrMut
Splits and returns the part of already built string, but keeps the extra capacity.
Source§impl<S: Storage> StrInner<S>
impl<S: Storage> StrInner<S>
Sourcepub fn into_inner(self) -> S
pub fn into_inner(self) -> S
Extracts the inner byte storage.
Sourcepub fn from_inner(s: S) -> Result<Self, Utf8Error<S>>
pub fn from_inner(s: S) -> Result<Self, Utf8Error<S>>
Creates an instance from an existing byte storage.
It may fail if the content is not valid UTF8.
A try_from may be used instead.
Sourcepub const unsafe fn from_inner_unchecked(s: S) -> Self
pub const unsafe fn from_inner_unchecked(s: S) -> Self
Sourcepub fn split_at_bytes(self, at: usize) -> (Self, Self)
pub fn split_at_bytes(self, at: usize) -> (Self, Self)
Sourcepub fn split_whitespace_bytes(self) -> impl Iterator<Item = Self>
pub fn split_whitespace_bytes(self) -> impl Iterator<Item = Self>
Splits into whitespace separated “words”.
This acts like split_whitespace, but yields owned instances. It doesn’t clone the content, it just increments some reference counts.
Sourcepub fn split_ascii_whitespace_bytes(self) -> impl Iterator<Item = Self>
pub fn split_ascii_whitespace_bytes(self) -> impl Iterator<Item = Self>
Splits into whitespace separated “words”.
This acts like split_ascii_whitespace, but yields owned instances. This doesn’t clone the content, it just increments some reference counts.
Sourcepub fn lines_bytes(self) -> impl Iterator<Item = Self>
pub fn lines_bytes(self) -> impl Iterator<Item = Self>
Splits into lines.
This acts like lines, but yields owned instances. The content is not cloned, this just increments some reference counts.
Sourcepub fn split_bytes<'s>(self, sep: &'s str) -> impl Iterator<Item = Self> + 'swhere
S: 's,
pub fn split_bytes<'s>(self, sep: &'s str) -> impl Iterator<Item = Self> + 'swhere
S: 's,
Splits with the provided separator.
This acts somewhat like split, but yields owned instances. Also, it accepts
only string patters (since the Pattern
is not stable ☹). The content is not cloned, this
just increments some reference counts.
Sourcepub fn splitn_bytes<'s>(
self,
n: usize,
sep: &'s str,
) -> impl Iterator<Item = Self> + 'swhere
S: 's,
pub fn splitn_bytes<'s>(
self,
n: usize,
sep: &'s str,
) -> impl Iterator<Item = Self> + 'swhere
S: 's,
Splits max. n
times according to the given pattern.
This acts somewhat like splitn, but yields owned instances. Also, it accepts
only string patters (since the Pattern
is not stable ☹). The content is not cloned, this
just increments some reference counts.
Sourcepub fn rsplit_bytes<'s>(self, sep: &'s str) -> impl Iterator<Item = Self> + 'swhere
S: 's,
pub fn rsplit_bytes<'s>(self, sep: &'s str) -> impl Iterator<Item = Self> + 'swhere
S: 's,
A reverse version of split_bytes.
Sourcepub fn rsplitn_bytes<'s>(
self,
n: usize,
sep: &'s str,
) -> impl Iterator<Item = Self> + 'swhere
S: 's,
pub fn rsplitn_bytes<'s>(
self,
n: usize,
sep: &'s str,
) -> impl Iterator<Item = Self> + 'swhere
S: 's,
A reverse version of splitn_bytes.
Trait Implementations
Source§impl<S: StorageMut> AddAssign<&str> for StrInner<S>
impl<S: StorageMut> AddAssign<&str> for StrInner<S>
Source§fn add_assign(&mut self, rhs: &str)
fn add_assign(&mut self, rhs: &str)
+=
operation. Read moreSource§impl<S: StorageMut> BorrowMut<str> for StrInner<S>
impl<S: StorageMut> BorrowMut<str> for StrInner<S>
Source§fn borrow_mut(&mut self) -> &mut str
fn borrow_mut(&mut self) -> &mut str
Source§impl<S: StorageMut> DerefMut for StrInner<S>
impl<S: StorageMut> DerefMut for StrInner<S>
Source§impl<'a, S: StorageMut> Extend<&'a String> for StrInner<S>
impl<'a, S: StorageMut> Extend<&'a String> for StrInner<S>
Source§fn extend<T: IntoIterator<Item = &'a String>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = &'a String>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl<'a, S: StorageMut> Extend<&'a char> for StrInner<S>
impl<'a, S: StorageMut> Extend<&'a char> for StrInner<S>
Source§fn extend<T: IntoIterator<Item = &'a char>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = &'a char>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl<'a, S: StorageMut> Extend<&'a str> for StrInner<S>
impl<'a, S: StorageMut> Extend<&'a str> for StrInner<S>
Source§fn extend<T: IntoIterator<Item = &'a str>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = &'a str>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl<S: StorageMut> Extend<Box<str>> for StrInner<S>
impl<S: StorageMut> Extend<Box<str>> for StrInner<S>
Source§fn extend<T: IntoIterator<Item = Box<str>>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Box<str>>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl<'a, S: StorageMut> Extend<Cow<'a, str>> for StrInner<S>
impl<'a, S: StorageMut> Extend<Cow<'a, str>> for StrInner<S>
Source§fn extend<T: IntoIterator<Item = Cow<'a, str>>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = Cow<'a, str>>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl<S: StorageMut> Extend<String> for StrInner<S>
impl<S: StorageMut> Extend<String> for StrInner<S>
Source§fn extend<T: IntoIterator<Item = String>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = String>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Source§impl<S: StorageMut> Extend<char> for StrInner<S>
impl<S: StorageMut> Extend<char> for StrInner<S>
Source§fn extend<T: IntoIterator<Item = char>>(&mut self, iter: T)
fn extend<T: IntoIterator<Item = char>>(&mut self, iter: T)
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)