Struct overvec::OverVec[][src]

#[repr(C)]pub struct OverVec<T, const MIN: usize> { /* fields omitted */ }

An over-aligned vector type.

  • T: The element type.
  • MIN: The minimum alignment. If the alignment of T is greater than this then that will be used.

Implementations

impl<T, const MIN: usize> OverVec<T, MIN>[src]

pub const ALIGN: usize[src]

This is the actual alignment that a particular OverVec instantiation will use.

pub const fn new() -> Self[src]

Constructs a new OverVec with no capacity.

  • Does not allocate.

pub fn with_capacity(cap: usize) -> Self[src]

Constructs a new, empty OverVec with at least the specified capacity.

Because of minimum alignment, the obtained capacity might be greater than requested.

let ov: OverVec<i32, 8> = OverVec::with_capacity(12);
assert_eq!(ov.capacity(), 12);

let ov2: OverVec<i32, 8> = OverVec::with_capacity(13);
assert_eq!(ov2.capacity(), 14);

pub const fn len(&self) -> usize[src]

The number of elements in the vec.

pub const fn capacity(&self) -> usize[src]

Returns the number of elements the vector can hold without reallocating.

pub fn push(&mut self, t: T)[src]

Push an element onto the end of the OverVec.

let mut ov: OverVec<i32, 8> = OverVec::with_capacity(12);
ov.push(5);
assert_eq!(&[5_i32][..], &ov[..]);

Trait Implementations

impl<T: Debug, const MIN: usize> Debug for OverVec<T, MIN>[src]

impl<T, const MIN: usize> Deref for OverVec<T, MIN>[src]

type Target = [T]

The resulting type after dereferencing.

impl<T, const MIN: usize> DerefMut for OverVec<T, MIN>[src]

impl<T, const MIN: usize> Drop for OverVec<T, MIN>[src]

Auto Trait Implementations

impl<T, const MIN: usize> !Send for OverVec<T, MIN>[src]

impl<T, const MIN: usize> !Sync for OverVec<T, MIN>[src]

impl<T, const MIN: usize> Unpin for OverVec<T, MIN>[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.