[−][src]Struct generic_vec::raw::Heap
This is supported on crate feature
alloc
only.A heap storage that can reallocate if necessary,
Usable with the alloc
feature
The allocator type paramter is only available on nightly
Implementations
impl<T> Heap<T>
[src]
pub const fn new() -> Self
[src]
Create a new zero-capacity heap vector
pub const unsafe fn from_raw_parts(ptr: NonNull<T>, capacity: usize) -> Self
[src]
Create a new Heap<T>
storage from the given pointer and capacity
Safety
If the capacity is non-zero
- You must have allocated the pointer from the
Global
allocator - The pointer must be valid to read-write for the range
ptr..ptr.add(capacity)
pub const fn into_raw_parts(self) -> (NonNull<T>, usize)
[src]
Convert a Heap
storage into a pointer and capacity, without
deallocating the storage
impl<T, A: AllocRef> Heap<T, A>
[src]
pub const fn with_alloc(alloc: A) -> Self
[src]
This is supported on crate feature
nightly
only.Create a new zero-capacity heap vector with the given allocator
pub const unsafe fn from_raw_parts_in(
ptr: NonNull<T>,
capacity: usize,
alloc: A
) -> Self
[src]
ptr: NonNull<T>,
capacity: usize,
alloc: A
) -> Self
This is supported on crate feature
nightly
only.Create a new Heap<T>
storage from the given pointer and capacity
Safety
If the capacity is non-zero
- You must have allocated the pointer from the given allocator
- The pointer must be valid to read-write for the range
ptr..ptr.add(capacity)
pub fn into_raw_parts_with_alloc(self) -> (NonNull<T>, usize, A)
[src]
This is supported on crate feature
nightly
only.Convert a Heap
storage into a pointer and capacity, without
deallocating the storage
Trait Implementations
impl<T, A: AllocRef + Default> Default for Heap<T, A>
[src]
impl<T, A: ?Sized + AllocRef> Drop for Heap<T, A>
[src]
impl<T, A: AllocRef + Send> Send for Heap<T, A>
[src]
impl<T, U, A: ?Sized + AllocRef> Storage<U> for Heap<T, A>
[src]
pub const IS_ALIGNED: bool
[src]
pub fn capacity(&self) -> usize
[src]
pub fn as_ptr(&self) -> *const U
[src]
pub fn as_mut_ptr(&mut self) -> *mut U
[src]
pub fn reserve(&mut self, new_capacity: usize)
[src]
pub fn try_reserve(&mut self, new_capacity: usize) -> bool
[src]
impl<T, U, A: Default + AllocRef> StorageWithCapacity<U> for Heap<T, A>
[src]
pub fn with_capacity(cap: usize) -> Self
[src]
impl<T, A: AllocRef + Sync> Sync for Heap<T, A>
[src]
Auto Trait Implementations
impl<T, A: ?Sized> RefUnwindSafe for Heap<T, A> where
A: RefUnwindSafe,
T: RefUnwindSafe,
A: RefUnwindSafe,
T: RefUnwindSafe,
impl<T, A: ?Sized> Unpin for Heap<T, A> where
A: Unpin,
A: Unpin,
impl<T, A: ?Sized> UnwindSafe for Heap<T, A> where
A: UnwindSafe,
T: RefUnwindSafe,
A: UnwindSafe,
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,
pub 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<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.
pub 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>,