Struct multistr::Dynamic [−][src]
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<T: StrLike + ?Sized> Dynamic<T>
[src]
impl<T: StrLike + ?Sized> Dynamic<T>
pub fn new() -> Dynamic<T>
[src]
pub fn new() -> Dynamic<T>
Creates an empty Dynamic
.
pub fn with_capacities(num: usize, data: usize) -> Dynamic<T>
[src]
pub fn with_capacities(num: usize, data: usize) -> Dynamic<T>
Creates an empty Dynamic
with the given capacities.
The Dynamic
will be able to hold exactly num
strings totallying up to data
in
length without reallocating. If num
and data
are zero, the vector will not
allocate.
pub fn num_capacity(&self) -> usize
[src]
pub fn num_capacity(&self) -> usize
Returns the number of strings this vector can hold without reallocating.
pub fn data_capacity(&self) -> usize
[src]
pub fn data_capacity(&self) -> usize
Returns the total length of strings this vector can hold without reallocating.
pub fn reserve(&mut self, additional: usize, bytes: usize)
[src]
pub fn reserve(&mut self, additional: usize, bytes: usize)
Reserves capacity for at least additional
more strings totalling to bytes
more
bytes.
pub fn reserve_exact(&mut self, additional: usize, bytes: usize)
[src]
pub fn reserve_exact(&mut self, additional: usize, bytes: usize)
Similar to reserve
, calling reserve_exact
on the inner String
and Vec
.
pub fn shrink_to_fit(&mut self)
[src]
pub fn shrink_to_fit(&mut self)
See: Vec::shrink_to_fit
.
pub fn truncate(&mut self, len: usize)
[src]
pub fn truncate(&mut self, len: usize)
Shortens the buffer, keeping the first len
slices and dropping the rest.
pub fn append(&mut self, other: &mut Dynamic<T>)
[src]
pub fn append(&mut self, other: &mut Dynamic<T>)
Moves all of the elements of other
into self
, leaving other
empty.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
Returns the number of strings in the vector.
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
Returns true
iff the vector contains no elements.
pub fn split_off(&mut self, at: usize) -> Dynamic<T>
[src]
pub fn split_off(&mut self, at: usize) -> Dynamic<T>
Splits the collection into two at the given index.
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
Clears the vector, removing all strings.
pub fn push(&mut self, t: &T)
[src]
pub fn push(&mut self, t: &T)
Adds a string to the end of the vec.
pub fn pop(&mut self) -> bool
[src]
pub fn pop(&mut self) -> bool
Removes a string from the end of the vec and discards it.
pub fn pop_off(&mut self) -> Option<<T as ToOwned>::Owned>
[src]
pub fn pop_off(&mut self) -> Option<<T as ToOwned>::Owned>
Removes a string from the end of the vec and allocates it onto a new buffer.
ⓘImportant traits for Iter<'a, T>pub fn iter(&self) -> Iter<T>
[src]
pub fn iter(&self) -> Iter<T>
Returns an iterator over the strings in the vector.
Trait Implementations
impl<T: StrLike + ?Sized> Send for Dynamic<T> where
&'static T::Data: Send,
T::OwnedData: Send,
[src]
impl<T: StrLike + ?Sized> Send for Dynamic<T> where
&'static T::Data: Send,
T::OwnedData: Send,
impl<T: StrLike + ?Sized> Sync for Dynamic<T> where
&'static T::Data: Sync,
T::OwnedData: Sync,
[src]
impl<T: StrLike + ?Sized> Sync for Dynamic<T> where
&'static T::Data: Sync,
T::OwnedData: Sync,
impl<T: StrLike + ?Sized> Default for Dynamic<T>
[src]
impl<T: StrLike + ?Sized> Default for Dynamic<T>
impl<'a, T: StrLike + ?Sized> FromIterator<&'a T> for Dynamic<T>
[src]
impl<'a, T: StrLike + ?Sized> FromIterator<&'a T> for Dynamic<T>
fn from_iter<I: IntoIterator<Item = &'a T>>(iter: I) -> Dynamic<T>
[src]
fn from_iter<I: IntoIterator<Item = &'a T>>(iter: I) -> Dynamic<T>
Creates a value from an iterator. Read more
impl<'a, T: StrLike + ?Sized> FromIterator<&'a &'a T> for Dynamic<T>
[src]
impl<'a, T: StrLike + ?Sized> FromIterator<&'a &'a T> for Dynamic<T>
fn from_iter<I: IntoIterator<Item = &'a &'a T>>(iter: I) -> Dynamic<T>
[src]
fn from_iter<I: IntoIterator<Item = &'a &'a T>>(iter: I) -> Dynamic<T>
Creates a value from an iterator. Read more
impl<'a, T: StrLike + ?Sized> Extend<&'a &'a T> for Dynamic<T>
[src]
impl<'a, T: StrLike + ?Sized> Extend<&'a &'a T> for Dynamic<T>
fn extend<I: IntoIterator<Item = &'a &'a T>>(&mut self, iter: I)
[src]
fn extend<I: IntoIterator<Item = &'a &'a T>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
impl<'a, T: StrLike + ?Sized> Extend<&'a T> for Dynamic<T>
[src]
impl<'a, T: StrLike + ?Sized> Extend<&'a T> for Dynamic<T>
fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I)
[src]
fn extend<I: IntoIterator<Item = &'a T>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
impl<'a, T: StrLike + ?Sized> IntoIterator for &'a Dynamic<T>
[src]
impl<'a, T: StrLike + ?Sized> IntoIterator for &'a Dynamic<T>
type Item = &'a T
The type of the elements being iterated over.
type IntoIter = Iter<'a, T>
Which kind of iterator are we turning this into?
ⓘImportant traits for Iter<'a, T>fn into_iter(self) -> Iter<'a, T>
[src]
fn into_iter(self) -> Iter<'a, T>
Creates an iterator from a value. Read more
impl<T: ?Sized + StrLike> Index<usize> for Dynamic<T>
[src]
impl<T: ?Sized + StrLike> Index<usize> for Dynamic<T>
type Output = T
The returned type after indexing.
fn index(&self, index: usize) -> &T
[src]
fn index(&self, index: usize) -> &T
Performs the indexing (container[index]
) operation.
impl<T: ?Sized + StrLike + StrLikeMut> IndexMut<usize> for Dynamic<T> where
T::Data: SplitAtMut<usize>,
T::OwnedData: BorrowMut<T::Data>,
[src]
impl<T: ?Sized + StrLike + StrLikeMut> IndexMut<usize> for Dynamic<T> where
T::Data: SplitAtMut<usize>,
T::OwnedData: BorrowMut<T::Data>,
fn index_mut(&mut self, index: usize) -> &mut T
[src]
fn index_mut(&mut self, index: usize) -> &mut T
Performs the mutable indexing (container[index]
) operation.
impl<T: ?Sized + DataConcat> Index<Range<usize>> for Dynamic<T>
[src]
impl<T: ?Sized + DataConcat> Index<Range<usize>> for Dynamic<T>
type Output = T
The returned type after indexing.
fn index(&self, range: Range<usize>) -> &T
[src]
fn index(&self, range: Range<usize>) -> &T
Performs the indexing (container[index]
) operation.
impl<T: ?Sized + DataConcat> Index<RangeFrom<usize>> for Dynamic<T>
[src]
impl<T: ?Sized + DataConcat> Index<RangeFrom<usize>> for Dynamic<T>
type Output = T
The returned type after indexing.
fn index(&self, range: RangeFrom<usize>) -> &T
[src]
fn index(&self, range: RangeFrom<usize>) -> &T
Performs the indexing (container[index]
) operation.
impl<T: ?Sized + DataConcat> Index<RangeTo<usize>> for Dynamic<T>
[src]
impl<T: ?Sized + DataConcat> Index<RangeTo<usize>> for Dynamic<T>
type Output = T
The returned type after indexing.
fn index(&self, range: RangeTo<usize>) -> &T
[src]
fn index(&self, range: RangeTo<usize>) -> &T
Performs the indexing (container[index]
) operation.
impl<T: ?Sized + DataConcat> Index<RangeFull> for Dynamic<T>
[src]
impl<T: ?Sized + DataConcat> Index<RangeFull> for Dynamic<T>
type Output = T
The returned type after indexing.
fn index(&self, _: RangeFull) -> &T
[src]
fn index(&self, _: RangeFull) -> &T
Performs the indexing (container[index]
) operation.
impl<T: ?Sized + StrLike> Clone for Dynamic<T> where
Cow<'static, T::Data>: Clone,
[src]
impl<T: ?Sized + StrLike> Clone for Dynamic<T> where
Cow<'static, T::Data>: Clone,
fn clone(&self) -> Dynamic<T>
[src]
fn clone(&self) -> Dynamic<T>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Dynamic<T>)
[src]
fn clone_from(&mut self, source: &Dynamic<T>)
Performs copy-assignment from source
. Read more
impl<T: ?Sized + StrLike> Hash for Dynamic<T> where
T::Data: Hash,
[src]
impl<T: ?Sized + StrLike> Hash for Dynamic<T> where
T::Data: Hash,
fn hash<H: Hasher>(&self, state: &mut H)
[src]
fn hash<H: Hasher>(&self, state: &mut H)
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]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T: ?Sized + StrLike + PartialEq> PartialEq for Dynamic<T>
[src]
impl<T: ?Sized + StrLike + PartialEq> PartialEq for Dynamic<T>
fn eq(&self, rhs: &Dynamic<T>) -> bool
[src]
fn eq(&self, rhs: &Dynamic<T>) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<'a, T: ?Sized + StrLike + PartialEq> PartialEq<&'a [&'a T]> for Dynamic<T>
[src]
impl<'a, T: ?Sized + StrLike + PartialEq> PartialEq<&'a [&'a T]> for Dynamic<T>
fn eq(&self, rhs: &&'a [&'a T]) -> bool
[src]
fn eq(&self, rhs: &&'a [&'a T]) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<'a, T: ?Sized + StrLike + PartialEq> PartialEq<Vec<&'a T>> for Dynamic<T>
[src]
impl<'a, T: ?Sized + StrLike + PartialEq> PartialEq<Vec<&'a T>> for Dynamic<T>
fn eq(&self, rhs: &Vec<&'a T>) -> bool
[src]
fn eq(&self, rhs: &Vec<&'a T>) -> 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[src]
fn ne(&self, other: &Rhs) -> bool
This method tests for !=
.
impl<T: ?Sized + StrLike + Eq> Eq for Dynamic<T>
[src]
impl<T: ?Sized + StrLike + Eq> Eq for Dynamic<T>
impl<T: ?Sized + StrLike + PartialOrd> PartialOrd for Dynamic<T>
[src]
impl<T: ?Sized + StrLike + PartialOrd> PartialOrd for Dynamic<T>
fn partial_cmp(&self, rhs: &Dynamic<T>) -> Option<Ordering>
[src]
fn partial_cmp(&self, rhs: &Dynamic<T>) -> 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[src]
fn lt(&self, other: &Rhs) -> bool
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[src]
fn le(&self, other: &Rhs) -> bool
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[src]
fn gt(&self, other: &Rhs) -> bool
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[src]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, T: ?Sized + StrLike + PartialOrd> PartialOrd<&'a [&'a T]> for Dynamic<T>
[src]
impl<'a, T: ?Sized + StrLike + PartialOrd> PartialOrd<&'a [&'a T]> for Dynamic<T>
fn partial_cmp(&self, rhs: &&'a [&'a T]) -> Option<Ordering>
[src]
fn partial_cmp(&self, rhs: &&'a [&'a T]) -> 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[src]
fn lt(&self, other: &Rhs) -> bool
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[src]
fn le(&self, other: &Rhs) -> bool
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[src]
fn gt(&self, other: &Rhs) -> bool
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[src]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, T: ?Sized + StrLike + PartialOrd> PartialOrd<Vec<&'a T>> for Dynamic<T>
[src]
impl<'a, T: ?Sized + StrLike + PartialOrd> PartialOrd<Vec<&'a T>> for Dynamic<T>
fn partial_cmp(&self, rhs: &Vec<&'a T>) -> Option<Ordering>
[src]
fn partial_cmp(&self, rhs: &Vec<&'a T>) -> 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[src]
fn lt(&self, other: &Rhs) -> bool
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[src]
fn le(&self, other: &Rhs) -> bool
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[src]
fn gt(&self, other: &Rhs) -> bool
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[src]
fn ge(&self, other: &Rhs) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: ?Sized + StrLike + Ord> Ord for Dynamic<T>
[src]
impl<T: ?Sized + StrLike + Ord> Ord for Dynamic<T>
fn cmp(&self, rhs: &Dynamic<T>) -> Ordering
[src]
fn cmp(&self, rhs: &Dynamic<T>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl<T: ?Sized + StrLike + Debug> Debug for Dynamic<T>
[src]
impl<T: ?Sized + StrLike + Debug> Debug for Dynamic<T>