Struct protobuf::RepeatedField[][src]

pub struct RepeatedField<T> { /* fields omitted */ }
Expand description

Wrapper around vector to avoid deallocations on clear.

Implementations

Return number of elements in this container.

Clear.

Create new empty container.

Create a contained with data from given vec.

Convert data into vec.

Return current capacity.

View data as slice.

View data as mutable slice.

Get subslice of this container.

Get mutable subslice of this container.

Get slice from given index.

Get mutable slice from given index.

Get slice to given index.

Get mutable slice to given index.

View this container as two slices split at given index.

View this container as two mutable slices split at given index.

View all but first elements of this container.

Last element of this container.

Mutable last element of this container.

View all but last elements of this container.

Push an element to the end.

Pop last element.

Insert an element at specified position.

Remove an element from specified position.

Retains only the elements specified by the predicate.

In other words, remove all elements e such that f(&e) returns false. This method operates in place, visiting each element exactly once in the original order, and preserves the order of the retained elements.

Examples

let mut vec = RepeatedField::from(vec![1, 2, 3, 4]);
vec.retain(|&x| x % 2 == 0);
assert_eq!(vec, RepeatedField::from(vec![2, 4]));

Truncate at specified length.

Reverse in place.

Into owned iterator.

Immutable data iterator.

Mutable data iterator.

Sort elements with given comparator.

Get data as raw pointer.

Get data a mutable raw pointer.

Push default value. This operation could be faster than rf.push(Default::default()), because it may reuse previously allocated and cleared element.

Copy slice data to RepeatedField

Copy slice data to RepeatedField

Copy this data into new vec.

True iff this container contains given element.

Trait Implementations

Performs the conversion.

Immutably borrows from an owned value. Read more

Clear this make, make it equivalent to newly created object.

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

The resulting type after dereferencing.

Dereferences the value.

Mutably dereferences the value.

Deserialize this value from the given Serde deserializer. Read more

Extends a collection with the contents of an iterator. Read more

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

Extends a collection with the contents of an iterator. Read more

🔬 This is a nightly-only experimental API. (extend_one)

Extends a collection with exactly one element.

🔬 This is a nightly-only experimental API. (extend_one)

Reserves capacity in a collection for the given number of additional elements. Read more

Performs the conversion.

Performs the conversion.

Creates a value from an iterator. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

The returned type after indexing.

Performs the indexing (container[index]) operation. Read more

Performs the mutable indexing (container[index]) operation. Read more

Performs the conversion.

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

The type of the elements being iterated over.

Which kind of iterator are we turning this into?

Creates an iterator from a value. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.