[−][src]Struct strchunk::StrChunkMut
A unique reference to a contiguous UTF-8 slice in memory.
StrChunkMut
builds on the memory slice view semantics of BytesMut
from
the bytes
crate, with the added guarantee that the content is a valid
UTF-8 string.
Implementations
impl StrChunkMut
[src]
pub fn new() -> Self
[src]
Creates a new StrChunkMut
with default capacity.
The returned buffer has initialized length 0 and unspecified capacity.
pub fn with_capacity(capacity: usize) -> Self
[src]
Creates a new StrChunkMut
with the specified capacity.
The returned buffer will be able to hold strings with lengths of
at least capacity
without reallocating. The initialized length
is 0.
pub fn len(&self) -> usize
[src]
Returns the length of the initialized string content in this
StrChunkMut
.
pub fn is_empty(&self) -> bool
[src]
Returns true if the initialized string content in StrChunkMut
has a length of 0.
pub fn capacity(&self) -> usize
[src]
Returns the maximum length of a string this StrChunkMut
can hold
without reallocating.
pub fn remaining_mut(&self) -> usize
[src]
Returns the maximum length of string content that can be appended past the current length without reallocating.
pub fn reserve(&mut self, additional: usize)
[src]
Reserves capacity for at least additional
more bytes of string
content to be inserted into this StrChunkMut
.
pub fn freeze(self) -> StrChunk
[src]
Converts self
into an immutable StrChunk
.
The conversion is zero cost and is used to indicate that the slice referenced by the handle will no longer be mutated. Once the conversion is done, the handle can be cloned and shared across threads.
pub fn as_str(&self) -> &str
[src]
Represents the StrChunkMut
contents as a string slice.
pub fn as_mut_str(&mut self) -> &mut str
[src]
Represents the StrChunkMut
contents as a mutable string slice.
pub fn put_char(&mut self, c: char)
[src]
Appends a Unicode character, encoded into UTF-8, to the initialized
string contents of the StrChunkMut
.
Panics
Panics if the remaining capacity is not sufficient to encode the
character. Four bytes are enough to encode any char
.
pub fn put_str<S: AsRef<str>>(&mut self, string: S)
[src]
Appends a string slice to the initialized string contents of the
StrChunkMut
.
Panics
Panics if the remaining capacity is not sufficient.
Trait Implementations
impl AsMut<str> for StrChunkMut
[src]
impl AsRef<[u8]> for StrChunkMut
[src]
impl AsRef<str> for StrChunkMut
[src]
impl Borrow<str> for StrChunkMut
[src]
impl BorrowMut<str> for StrChunkMut
[src]
fn borrow_mut(&mut self) -> &mut str
[src]
impl Clone for StrChunkMut
[src]
fn clone(&self) -> StrChunkMut
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Debug for StrChunkMut
[src]
impl Default for StrChunkMut
[src]
fn default() -> StrChunkMut
[src]
impl Deref for StrChunkMut
[src]
impl DerefMut for StrChunkMut
[src]
impl Display for StrChunkMut
[src]
impl Eq for StrChunkMut
[src]
impl<'a> Extend<&'a str> for StrChunkMut
[src]
fn extend<T>(&mut self, iterable: T) where
T: IntoIterator<Item = &'a str>,
[src]
T: IntoIterator<Item = &'a str>,
fn extend_one(&mut self, item: A)
[src]
fn extend_reserve(&mut self, additional: usize)
[src]
impl Extend<char> for StrChunkMut
[src]
fn extend<T>(&mut self, iterable: T) where
T: IntoIterator<Item = char>,
[src]
T: IntoIterator<Item = char>,
fn extend_one(&mut self, item: A)
[src]
fn extend_reserve(&mut self, additional: usize)
[src]
impl<'a> From<&'a str> for StrChunkMut
[src]
fn from(src: &'a str) -> StrChunkMut
[src]
impl From<StrChunkMut> for StrChunk
[src]
fn from(src: StrChunkMut) -> StrChunk
[src]
impl From<StrChunkMut> for Bytes
[src]
fn from(src: StrChunkMut) -> Bytes
[src]
impl From<StrChunkMut> for BytesMut
[src]
fn from(src: StrChunkMut) -> BytesMut
[src]
impl<'a> FromIterator<&'a str> for StrChunkMut
[src]
fn from_iter<T>(iterable: T) -> Self where
T: IntoIterator<Item = &'a str>,
[src]
T: IntoIterator<Item = &'a str>,
impl FromIterator<char> for StrChunkMut
[src]
fn from_iter<T>(iterable: T) -> Self where
T: IntoIterator<Item = char>,
[src]
T: IntoIterator<Item = char>,
impl Hash for StrChunkMut
[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 Ord for StrChunkMut
[src]
fn cmp(&self, other: &StrChunkMut) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl<'a> PartialEq<&'a str> for StrChunkMut
[src]
impl<'a> PartialEq<Cow<'a, str>> for StrChunkMut
[src]
fn eq(&self, other: &Cow<'a, str>) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<StrChunk> for StrChunkMut
[src]
impl PartialEq<StrChunkMut> for StrChunk
[src]
fn eq(&self, other: &StrChunkMut) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<StrChunkMut> for StrChunkMut
[src]
fn eq(&self, other: &StrChunkMut) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<StrChunkMut> for str
[src]
fn eq(&self, other: &StrChunkMut) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialEq<StrChunkMut> for &'a str
[src]
fn eq(&self, other: &StrChunkMut) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<StrChunkMut> for String
[src]
fn eq(&self, other: &StrChunkMut) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialEq<StrChunkMut> for Cow<'a, str>
[src]
fn eq(&self, other: &StrChunkMut) -> bool
[src]
#[must_use]fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialEq<String> for StrChunkMut
[src]
impl PartialEq<str> for StrChunkMut
[src]
impl<'a> PartialOrd<&'a str> for StrChunkMut
[src]
fn partial_cmp(&self, other: &&'a str) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialOrd<Cow<'a, str>> for StrChunkMut
[src]
fn partial_cmp(&self, other: &Cow<'a, str>) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<StrChunk> for StrChunkMut
[src]
fn partial_cmp(&self, other: &StrChunk) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<StrChunkMut> for StrChunk
[src]
fn partial_cmp(&self, other: &StrChunkMut) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<StrChunkMut> for StrChunkMut
[src]
fn partial_cmp(&self, other: &StrChunkMut) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<StrChunkMut> for str
[src]
fn partial_cmp(&self, other: &StrChunkMut) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialOrd<StrChunkMut> for &'a str
[src]
fn partial_cmp(&self, other: &StrChunkMut) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<StrChunkMut> for String
[src]
fn partial_cmp(&self, other: &StrChunkMut) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a> PartialOrd<StrChunkMut> for Cow<'a, str>
[src]
fn partial_cmp(&self, other: &StrChunkMut) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<String> for StrChunkMut
[src]
fn partial_cmp(&self, other: &String) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl PartialOrd<str> for StrChunkMut
[src]
fn partial_cmp(&self, other: &str) -> Option<Ordering>
[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl StructuralEq for StrChunkMut
[src]
impl TakeRange<RangeFrom<usize>> for StrChunkMut
[src]
type Output = StrChunkMut
The value returned by the take_range
method, representing
the extracted part of the collection. Read more
fn take_range(&mut self, range: RangeFrom<usize>) -> Self::Output
[src]
fn remove_range(&mut self, range: RangeFrom<usize>)
[src]
impl TakeRange<RangeFull> for StrChunkMut
[src]
type Output = StrChunkMut
The value returned by the take_range
method, representing
the extracted part of the collection. Read more
fn take_range(&mut self, range: RangeFull) -> Self::Output
[src]
fn remove_range(&mut self, range: RangeFull)
[src]
impl TakeRange<RangeTo<usize>> for StrChunkMut
[src]
type Output = StrChunkMut
The value returned by the take_range
method, representing
the extracted part of the collection. Read more
fn take_range(&mut self, range: RangeTo<usize>) -> Self::Output
[src]
fn remove_range(&mut self, range: RangeTo<usize>)
[src]
impl TakeRange<RangeToInclusive<usize>> for StrChunkMut
[src]
type Output = StrChunkMut
The value returned by the take_range
method, representing
the extracted part of the collection. Read more
fn take_range(&mut self, range: RangeToInclusive<usize>) -> Self::Output
[src]
fn remove_range(&mut self, range: RangeToInclusive<usize>)
[src]
impl TryFrom<BytesMut> for StrChunkMut
[src]
Auto Trait Implementations
impl RefUnwindSafe for StrChunkMut
impl Send for StrChunkMut
impl Sync for StrChunkMut
impl Unpin for StrChunkMut
impl UnwindSafe for StrChunkMut
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub 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.
pub 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>,