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>
impl<T, A: Alignment> ARawVec<T, A>
const MIN_NON_ZERO_CAP: usize
Sourcepub unsafe fn new_unchecked(align: usize) -> Self
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>()
.
Sourcepub unsafe fn with_capacity_unchecked(capacity: usize, align: usize) -> Self
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>()
.
Sourcepub unsafe fn try_with_capacity_unchecked(
capacity: usize,
align: usize,
) -> Result<Self, TryReserveError>
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>()
.
pub unsafe fn grow_amortized(&mut self, len: usize, additional: usize)
pub unsafe fn grow_exact(&mut self, len: usize, additional: usize)
pub unsafe fn try_grow_amortized( &mut self, len: usize, additional: usize, ) -> Result<(), TryReserveError>
pub unsafe fn try_grow_exact( &mut self, len: usize, additional: usize, ) -> Result<(), TryReserveError>
pub unsafe fn shrink_to(&mut self, len: usize)
pub unsafe fn from_raw_parts(ptr: *mut T, capacity: usize, align: usize) -> Self
pub fn align(&self) -> usize
pub fn as_ptr(&self) -> *const T
pub fn as_mut_ptr(&mut self) -> *mut T
Trait Implementations§
Auto Trait Implementations§
impl<T, A> Freeze for ARawVec<T, A>where
A: Freeze,
impl<T, A> RefUnwindSafe for ARawVec<T, A>where
A: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, A> !Send for ARawVec<T, A>
impl<T, A> !Sync for ARawVec<T, A>
impl<T, A> Unpin for ARawVec<T, A>
impl<T, A> UnwindSafe for ARawVec<T, A>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more