Struct ARawVec

Source
pub struct ARawVec<T, A: Alignment> {
    pub ptr: NonNull<T>,
    pub capacity: usize,
    pub align: A,
    _marker: PhantomData<T>,
}

Fields§

§ptr: NonNull<T>§capacity: usize§align: A§_marker: PhantomData<T>

Implementations§

Source§

impl<T, A: Alignment> ARawVec<T, A>

Source

const MIN_NON_ZERO_CAP: usize

Source

pub unsafe fn new_unchecked(align: usize) -> Self

§Safety

align must be a power of two.
align must be greater than or equal to core::mem::align_of::<T>().

Source

pub unsafe fn with_capacity_unchecked(capacity: usize, align: usize) -> Self

§Safety

align must be a power of two.
align must be greater than or equal to core::mem::align_of::<T>().

Source

pub unsafe fn try_with_capacity_unchecked( capacity: usize, align: usize, ) -> Result<Self, TryReserveError>

§Safety

align must be a power of two.
align must be greater than or equal to core::mem::align_of::<T>().

Source

pub unsafe fn grow_amortized(&mut self, len: usize, additional: usize)

Source

pub unsafe fn grow_exact(&mut self, len: usize, additional: usize)

Source

pub unsafe fn try_grow_amortized( &mut self, len: usize, additional: usize, ) -> Result<(), TryReserveError>

Source

pub unsafe fn try_grow_exact( &mut self, len: usize, additional: usize, ) -> Result<(), TryReserveError>

Source

pub unsafe fn shrink_to(&mut self, len: usize)

Source

pub unsafe fn from_raw_parts(ptr: *mut T, capacity: usize, align: usize) -> Self

Source

pub fn capacity(&self) -> usize

Returns the capacity of the vector.

Source

pub fn align(&self) -> usize

Source

pub fn as_ptr(&self) -> *const T

Source

pub fn as_mut_ptr(&mut self) -> *mut T

Trait Implementations§

Source§

impl<T, A: Alignment> Drop for ARawVec<T, A>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl<T, A> Freeze for ARawVec<T, A>
where A: Freeze,

§

impl<T, A> RefUnwindSafe for ARawVec<T, A>

§

impl<T, A> !Send for ARawVec<T, A>

§

impl<T, A> !Sync for ARawVec<T, A>

§

impl<T, A> Unpin for ARawVec<T, A>
where A: Unpin, T: Unpin,

§

impl<T, A> UnwindSafe for ARawVec<T, A>

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where 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 T
where 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 T
where U: Into<T>,

Source§

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 T
where U: TryFrom<T>,

Source§

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.