Struct multistr::vec::StringVec
[−]
[src]
pub struct StringVec { /* fields omitted */ }
Vec of immutable strings stored on the heap in the same buffer.
Slicing ranges of the vector yields the strings in the range concatenated together.
Methods
impl StringVec
[src]
fn new() -> StringVec
Creates an empty StringVec
.
fn with_capacities(num: usize, bytes: usize) -> StringVec
Creates an empty StringVec
with the given capacities.
The StringVec
will be able to hold exactly count
strings totallying up to bytes
in
length without reallocating. If count
and bytes
are zero, the vector will not
allocate.
fn num_capacity(&self) -> usize
Returns the number of strings this vector can hold without reallocating.
fn byte_capacity(&self) -> usize
Returns the number of bytes this vector can hold without reallocating.
fn reserve(&mut self, additional: usize, bytes: usize)
Reserves capacity for at least additional
more strings totalling to bytes
more
bytes.
fn reserve_exact(&mut self, additional: usize, bytes: usize)
Similar to reserve
, calling reserve_exact
on the inner String
and Vec
.
fn shrink_to_fit(&mut self)
See: Vec::shrink_to_fit
.
fn truncate(&mut self, len: usize)
Shortens the vector, keeping the first len
strings and dropping the rest.
fn append(&mut self, other: &mut StringVec)
Moves all of the elements of other
into self
, leaving other
empty.
fn len(&self) -> usize
Returns the number of strings in the vector.
fn is_empty(&self) -> bool
Returns true
iff the vector contains no elements.
fn split_off(&mut self, at: usize) -> StringVec
Splits the collection into two at the given index.
fn clear(&mut self)
Clears the vector, removing all strings.
fn push<S: AsRef<str>>(&mut self, s: S)
Adds a string to the end of the vec.
fn pop(&mut self) -> bool
Removes a string from the end of the vec and discards it.
fn pop_off(&mut self) -> Option<String>
Removes a string from the end of the vec and allocates it onto a new buffer.
fn iter(&self) -> Iter
Returns an iterator over the strings in the vector.
Trait Implementations
impl Eq for StringVec
[src]
impl PartialEq for StringVec
[src]
fn eq(&self, __arg_0: &StringVec) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &StringVec) -> bool
This method tests for !=
.
impl Clone for StringVec
[src]
fn clone(&self) -> StringVec
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 Default for StringVec
[src]
impl Hash for StringVec
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the state given, updating the hasher as necessary.
fn hash_slice<H>(data: &[Self], state: &mut H) where H: Hasher
1.3.0
Feeds a slice of this type into the state provided.
impl<S: AsRef<str>> FromIterator<S> for StringVec
[src]
fn from_iter<T: IntoIterator<Item=S>>(iter: T) -> StringVec
Creates a value from an iterator. Read more
impl<S: AsRef<str>> Extend<S> for StringVec
[src]
fn extend<T: IntoIterator<Item=S>>(&mut self, iter: T)
Extends a collection with the contents of an iterator. Read more
impl Index<usize> for StringVec
[src]
type Output = str
The returned type after indexing
fn index(&self, index: usize) -> &str
The method for the indexing (container[index]
) operation
impl Index<Range<usize>> for StringVec
[src]
type Output = str
The returned type after indexing
fn index(&self, index: Range<usize>) -> &str
The method for the indexing (container[index]
) operation
impl Index<RangeTo<usize>> for StringVec
[src]
type Output = str
The returned type after indexing
fn index(&self, index: RangeTo<usize>) -> &str
The method for the indexing (container[index]
) operation
impl Index<RangeFrom<usize>> for StringVec
[src]
type Output = str
The returned type after indexing
fn index(&self, index: RangeFrom<usize>) -> &str
The method for the indexing (container[index]
) operation
impl Index<RangeFull> for StringVec
[src]
type Output = str
The returned type after indexing
fn index(&self, _: RangeFull) -> &str
The method for the indexing (container[index]
) operation
impl<'a> IntoIterator for &'a StringVec
[src]
type IntoIter = Iter<'a>
Which kind of iterator are we turning this into?
type Item = &'a str
The type of the elements being iterated over.
fn into_iter(self) -> Iter<'a>
Creates an iterator from a value. Read more
impl IntoIterator for StringVec
[src]
type IntoIter = IntoIter
Which kind of iterator are we turning this into?
type Item = String
The type of the elements being iterated over.
fn into_iter(self) -> IntoIter
Creates an iterator from a value. Read more
impl PartialOrd for StringVec
[src]
fn partial_cmp(&self, rhs: &StringVec) -> 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 Ord for StringVec
[src]
fn cmp(&self, rhs: &StringVec) -> Ordering
This method returns an Ordering
between self
and other
. Read more