[−][src]Struct ordnung::compact::Vec
A contiguous growable array type, written Vec<T>
but pronounced 'vector'.
Methods
impl<T> Vec<T>
[src]
pub fn new() -> Self
[src]
Constructs a new, empty Vec
The vector will not allocate until elements are pushed onto it.
pub fn with_capacity(capacity: usize) -> Self
[src]
Constructs a new, empty Vec
The vector will be able to hold exactly capacity elements without reallocating. If capacity is 0, the vector will not allocate.
pub fn push(&mut self, val: T)
[src]
Appends an element to the back of a collection.
Panics
Panics if the number of elements in the vector overflows a u32
.
pub fn pop(&mut self) -> Option<T>
[src]
Removes the last element from a vector and returns it, or None
if it is empty.
pub fn clear(&mut self)
[src]
Clears the vector, removing all values.
Note that this method has no effect on the allocated capacity of the vector.
pub fn len(&self) -> usize
[src]
Returns the number of elements in the vector.
pub fn capacity(&self) -> usize
[src]
Returns the number of elements the vector can hold without reallocating.
pub fn remove(&mut self, index: usize) -> T
[src]
Removes and returns the element at position index
within the vector,
shifting all elements after it to the left.
pub const fn as_ptr(&self) -> *const T
[src]
Returns a raw pointer to the vector's buffer.
pub fn as_mut_ptr(&mut self) -> *mut T
[src]
Returns an unsafe mutable pointer to the vector's buffer.
Trait Implementations
impl<T: Clone> Clone for Vec<T>
[src]
impl<T: Debug> Debug for Vec<T>
[src]
impl<T> Deref for Vec<T>
[src]
impl<T> DerefMut for Vec<T>
[src]
impl<T> Drop for Vec<T>
[src]
impl<T> From<Vec<T>> for Vec<T>
[src]
impl<T> From<Vec<T>> for StdVec<T>
[src]
impl<T> FromIterator<T> for Vec<T>
[src]
fn from_iter<I>(iter: I) -> Vec<T> where
I: IntoIterator<Item = T>,
[src]
I: IntoIterator<Item = T>,
impl<T> IntoIterator for Vec<T>
[src]
type Item = T
The type of the elements being iterated over.
type IntoIter = IntoIter<T>
Which kind of iterator are we turning this into?
fn into_iter(self) -> IntoIter<T>
[src]
impl<T: PartialEq> PartialEq<Vec<T>> for Vec<T>
[src]
impl<T: Send> Send for Vec<T>
[src]
impl<T: Sync> Sync for Vec<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Vec<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Unpin for Vec<T>
impl<T> UnwindSafe for Vec<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<I> IntoIterator for I where
I: Iterator,
[src]
I: Iterator,
type Item = <I as Iterator>::Item
The type of the elements being iterated over.
type IntoIter = I
Which kind of iterator are we turning this into?
fn into_iter(self) -> I
[src]
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>,