[−][src]Struct protobuf::RepeatedField
Wrapper around vector to avoid deallocations on clear.
Methods
impl<T> RepeatedField<T>
[src]
pub fn len(&self) -> usize
[src]
Return number of elements in this container.
pub fn clear(&mut self)
[src]
Clear.
impl<T> RepeatedField<T>
[src]
pub fn new() -> RepeatedField<T>
[src]
Create new empty container.
pub fn from_vec(vec: Vec<T>) -> RepeatedField<T>
[src]
Create a contained with data from given vec.
pub fn into_vec(self) -> Vec<T>
[src]
Convert data into vec.
pub fn capacity(&self) -> usize
[src]
Return current capacity.
pub fn as_slice<'a>(&'a self) -> &'a [T]
[src]
View data as slice.
pub fn as_mut_slice<'a>(&'a mut self) -> &'a mut [T]
[src]
View data as mutable slice.
pub fn slice(&self, start: usize, end: usize) -> &[T]
[src]
Get subslice of this container.
pub fn slice_mut(&mut self, start: usize, end: usize) -> &mut [T]
[src]
Get mutable subslice of this container.
pub fn slice_from(&self, start: usize) -> &[T]
[src]
Get slice from given index.
pub fn slice_from_mut(&mut self, start: usize) -> &mut [T]
[src]
Get mutable slice from given index.
pub fn slice_to(&self, end: usize) -> &[T]
[src]
Get slice to given index.
pub fn slice_to_mut(&mut self, end: usize) -> &mut [T]
[src]
Get mutable slice to given index.
pub fn split_at<'a>(&'a self, mid: usize) -> (&'a [T], &'a [T])
[src]
View this container as two slices split at given index.
pub fn split_at_mut<'a>(&'a mut self, mid: usize) -> (&'a mut [T], &'a mut [T])
[src]
View this container as two mutable slices split at given index.
pub fn tail(&self) -> &[T]
[src]
View all but first elements of this container.
pub fn last(&self) -> Option<&T>
[src]
Last element of this container.
pub fn last_mut<'a>(&'a mut self) -> Option<&'a mut T>
[src]
Mutable last element of this container.
pub fn init<'a>(&'a self) -> &'a [T]
[src]
View all but last elements of this container.
pub fn push(&mut self, value: T)
[src]
Push an element to the end.
pub fn pop(&mut self) -> Option<T>
[src]
Pop last element.
pub fn insert(&mut self, index: usize, value: T)
[src]
Insert an element at specified position.
pub fn remove(&mut self, index: usize) -> T
[src]
Remove an element from specified position.
pub fn truncate(&mut self, len: usize)
[src]
Truncate at specified length.
pub fn reverse(&mut self)
[src]
Reverse in place.
pub fn into_iter(self) -> IntoIter<T>
[src]
Into owned iterator.
pub fn iter<'a>(&'a self) -> Iter<'a, T>
[src]
Immutable data iterator.
pub fn iter_mut<'a>(&'a mut self) -> IterMut<'a, T>
[src]
Mutable data iterator.
pub fn sort_by<F>(&mut self, compare: F) where
F: Fn(&T, &T) -> Ordering,
[src]
F: Fn(&T, &T) -> Ordering,
Sort elements with given comparator.
pub fn as_ptr(&self) -> *const T
[src]
Get data as raw pointer.
pub fn as_mut_ptr(&mut self) -> *mut T
[src]
Get data a mutable raw pointer.
impl<T: Default + Clear> RepeatedField<T>
[src]
pub fn push_default<'a>(&'a mut self) -> &'a mut T
[src]
Push default value.
This operation could be faster than rf.push(Default::default())
,
because it may reuse previously allocated and cleared element.
impl<T: Clone> RepeatedField<T>
[src]
pub fn from_slice(values: &[T]) -> RepeatedField<T>
[src]
Copy slice data to RepeatedField
pub fn from_ref<X: AsRef<[T]>>(values: X) -> RepeatedField<T>
[src]
Copy slice data to RepeatedField
pub fn to_vec(&self) -> Vec<T>
[src]
Copy this data into new vec.
impl<T: PartialEq> RepeatedField<T>
[src]
Trait Implementations
impl<T> Clear for RepeatedField<T>
[src]
impl<T> Default for RepeatedField<T>
[src]
fn default() -> RepeatedField<T>
[src]
impl<T: Clone> Clone for RepeatedField<T>
[src]
fn clone(&self) -> RepeatedField<T>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<T> From<Vec<T>> for RepeatedField<T>
[src]
fn from(values: Vec<T>) -> RepeatedField<T>
[src]
impl<'a, T: Clone> From<&'a [T]> for RepeatedField<T>
[src]
fn from(values: &'a [T]) -> RepeatedField<T>
[src]
impl<T: Eq> Eq for RepeatedField<T>
[src]
impl<T> Into<Vec<T>> for RepeatedField<T>
[src]
impl<'a, T> IntoIterator for &'a RepeatedField<T>
[src]
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?
fn into_iter(self) -> Iter<'a, T>
[src]
impl<T: PartialEq> PartialEq<RepeatedField<T>> for RepeatedField<T>
[src]
fn eq(&self, other: &RepeatedField<T>) -> bool
[src]
#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<T> AsRef<[T]> for RepeatedField<T>
[src]
impl<T> DerefMut for RepeatedField<T>
[src]
impl<T: Debug> Debug for RepeatedField<T>
[src]
impl<T> Deref for RepeatedField<T>
[src]
impl<T> Index<usize> for RepeatedField<T>
[src]
impl<T> IndexMut<usize> for RepeatedField<T>
[src]
impl<T: Hash> Hash for RepeatedField<T>
[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,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<T> FromIterator<T> for RepeatedField<T>
[src]
fn from_iter<I: IntoIterator<Item = T>>(iter: I) -> RepeatedField<T>
[src]
impl<T> Borrow<[T]> for RepeatedField<T>
[src]
Auto Trait Implementations
impl<T> Send for RepeatedField<T> where
T: Send,
T: Send,
impl<T> Sync for RepeatedField<T> where
T: Sync,
T: Sync,
Blanket Implementations
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.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,