Struct str::Str
[−]
[src]
pub struct Str { /* fields omitted */ }
Methods
impl Str
[src]
fn new() -> Str
fn with_capacity(capacity: usize) -> Str
fn capacity(&self) -> usize
fn reserve(&mut self, additional: usize)
fn reserve_exact(&mut self, additional: usize)
fn shrink_to_fit(&mut self)
fn as_bytes(&self) -> Vec<u8>
fn as_slice(&self) -> &[char]
fn as_slice_mut(&mut self) -> &mut [char]
fn as_vec(self) -> Vec<char>
fn as_mut_slice(&mut self) -> &mut [char]
fn retain<F>(&mut self, f: F) where
F: FnMut(&char) -> bool,
F: FnMut(&char) -> bool,
fn get(&self, idx: usize) -> Option<&char>
fn get_mut(&mut self, idx: usize) -> Option<&mut char>
fn truncate(&mut self, new_len: usize)
fn push(&mut self, ch: char)
fn push_str(&mut self, string: &str)
fn pop(&mut self) -> Option<char>
fn remove(&mut self, idx: usize) -> char
fn insert(&mut self, idx: usize, ch: char)
fn insert_str(&mut self, _idx: usize, _string: &str)
fn append(&mut self, other: &mut Self)
fn len(&self) -> usize
fn is_empty(&self) -> bool
fn split_off(&mut self, at: usize) -> Str
fn split_at(&self, mid: usize) -> (Str, Str)
fn clear(&mut self)
fn iter(self) -> StrIterator
Trait Implementations
impl Clone for Str
[src]
fn clone(&self) -> Str
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Str
[src]
impl<'a> From<&'a str> for Str
[src]
impl From<String> for Str
[src]
impl<'a> From<&'a [char]> for Str
[src]
impl<'a> From<&'a mut [char]> for Str
[src]
impl Into<String> for Str
[src]
impl Default for Str
[src]
impl IntoIterator for Str
[src]
type Item = char
The type of the elements being iterated over.
type IntoIter = StrIterator
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl AsRef<Str> for Str
[src]
impl AsMut<Str> for Str
[src]
impl AsRef<[char]> for Str
[src]
impl AsMut<[char]> for Str
[src]
impl Add for Str
[src]
type Output = Str
The resulting type after applying the +
operator
fn add(self, other: Str) -> Str
The method for the +
operator
impl AddAssign for Str
[src]
fn add_assign(&mut self, other: Str)
The method for the +=
operator
impl PartialEq for Str
[src]
fn eq(&self, other: &Str) -> bool
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
This method tests for !=
.
impl PartialOrd for Str
[src]
fn partial_cmp(&self, other: &Str) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &Rhs) -> bool
1.0.0
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &Rhs) -> bool
1.0.0
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &Rhs) -> bool
1.0.0
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl Index<usize> for Str
[src]
type Output = char
The returned type after indexing
fn index(&self, idx: usize) -> &char
The method for the indexing (container[index]
) operation
impl Index<RangeFrom<usize>> for Str
[src]
type Output = [char]
The returned type after indexing
fn index(&self, range: RangeFrom<usize>) -> &[char]
The method for the indexing (container[index]
) operation
impl Index<RangeTo<usize>> for Str
[src]
type Output = [char]
The returned type after indexing
fn index(&self, range: RangeTo<usize>) -> &[char]
The method for the indexing (container[index]
) operation
impl Index<RangeFull> for Str
[src]
type Output = [char]
The returned type after indexing
fn index(&self, _range: RangeFull) -> &[char]
The method for the indexing (container[index]
) operation
impl IndexMut<usize> for Str
[src]
fn index_mut(&mut self, idx: usize) -> &mut char
The method for the mutable indexing (container[index]
) operation
impl IndexMut<RangeFrom<usize>> for Str
[src]
fn index_mut(&mut self, range: RangeFrom<usize>) -> &mut [char]
The method for the mutable indexing (container[index]
) operation
impl IndexMut<RangeTo<usize>> for Str
[src]
fn index_mut(&mut self, range: RangeTo<usize>) -> &mut [char]
The method for the mutable indexing (container[index]
) operation