Struct orx_fixed_vec::FixedVec

source ·
pub struct FixedVec<T> { /* private fields */ }

Implementations§

source§

impl<T> FixedVec<T>

source

pub fn new(fixed_capacity: usize) -> Self

source

pub fn room(&self) -> usize

source

pub fn is_full(&self) -> bool

Trait Implementations§

source§

impl<T> AsMut<[T]> for FixedVec<T>

source§

fn as_mut(&mut self) -> &mut [T]

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<T> AsRef<[T]> for FixedVec<T>

source§

fn as_ref(&self) -> &[T]

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<T> Debug for FixedVec<T>where T: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T> From<FixedVec<T>> for Vec<T>

source§

fn from(value: FixedVec<T>) -> Self

Converts to this type from the input type.
source§

impl<T> From<Vec<T, Global>> for FixedVec<T>

source§

fn from(value: Vec<T>) -> Self

Converts to this type from the input type.
source§

impl<T, I> Index<I> for FixedVec<T>where I: SliceIndex<[T]>,

§

type Output = <I as SliceIndex<[T]>>::Output

The returned type after indexing.
source§

fn index(&self, index: I) -> &Self::Output

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

impl<T, I> IndexMut<I> for FixedVec<T>where I: SliceIndex<[T]>,

source§

fn index_mut(&mut self, index: I) -> &mut Self::Output

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

impl<T> IntoIterator for FixedVec<T>

§

type Item = T

The type of the elements being iterated over.
§

type IntoIter = IntoIter<T, Global>

Which kind of iterator are we turning this into?
source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
source§

impl<T, U> PartialEq<U> for FixedVec<T>where U: AsRef<[T]>, T: PartialEq,

source§

fn eq(&self, other: &U) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl<T> PinnedVec<T> for FixedVec<T>

source§

fn capacity(&self) -> usize

Returns the total number of elements the vector can hold without reallocating.
source§

fn clear(&mut self)

Clears the vector, removing all values. Read more
source§

fn extend_from_slice(&mut self, other: &[T])where T: Clone,

Clones and appends all elements in a slice to the Vec. Read more
source§

fn get(&self, index: usize) -> Option<&T>

Returns a reference to an element with the given index, returns None if the index is out of bounds.
source§

fn get_mut(&mut self, index: usize) -> Option<&mut T>

Returns a mutable reference to an element with the given index, returns None if the index is out of bounds.
source§

unsafe fn get_unchecked(&self, index: usize) -> &T

Returns a reference to an element or subslice, without doing bounds checking. Read more
source§

unsafe fn get_unchecked_mut(&mut self, index: usize) -> &mut T

Returns a mutable reference to an element or subslice, without doing bounds checking. Read more
source§

fn insert(&mut self, index: usize, element: T)

Inserts an element at position index within the vector, shifting all elements after it to the right. Read more
source§

fn is_empty(&self) -> bool

Returns true if the vector contains no elements.
source§

fn len(&self) -> usize

Returns the number of elements in the vector, also referred to as its ‘length’.
source§

fn pop(&mut self) -> Option<T>

Removes the last element from a vector and returns it, or None if it is empty.
source§

fn push(&mut self, value: T)

Appends an element to the back of a collection.
source§

fn remove(&mut self, index: usize) -> T

Removes and returns the element at position index within the vector, shifting all elements after it to the left. Read more
source§

fn partial_eq<S>(&self, other: S) -> boolwhere S: AsRef<[T]>, T: PartialEq,

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

fn debug(&self, f: &mut Formatter<'_>) -> Resultwhere T: Debug,

Formats the value using the given formatter.

Auto Trait Implementations§

§

impl<T> RefUnwindSafe for FixedVec<T>where T: RefUnwindSafe,

§

impl<T> Send for FixedVec<T>where T: Send,

§

impl<T> Sync for FixedVec<T>where T: Sync,

§

impl<T> Unpin for FixedVec<T>where T: Unpin,

§

impl<T> UnwindSafe for FixedVec<T>where T: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.