[][src]Struct generic_vec::raw::Heap

#[repr(C)]pub struct Heap<T, A: ?Sized + AllocRef = Global> { /* fields omitted */ }
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]

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]

impl<T, U, A: Default + AllocRef> StorageWithCapacity<U> for Heap<T, A>[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

impl<T, A: ?Sized> Unpin for Heap<T, A> where
    A: Unpin

impl<T, A: ?Sized> UnwindSafe for Heap<T, A> where
    A: UnwindSafe,
    T: RefUnwindSafe

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.