Struct cl_generic_vec::raw::Heap[][src]

#[repr(C)]
pub struct Heap<T, A: Allocator = Global>(_);
This is supported on crate feature alloc only.
Expand description

A heap storage that can reallocate if necessary,

Usable with the alloc feature

The allocator type paramter is only available on nightly

Implementations

Create a new zero-capacity heap vector

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)

Convert a Heap storage into a pointer and capacity, without deallocating the storage

This is supported on crate feature nightly only.

Create a new zero-capacity heap vector with the given allocator

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)
This is supported on crate feature nightly only.

Convert a Heap storage into a pointer and capacity, without deallocating the storage

Trait Implementations

Returns the “default value” for a type. Read more

Is the pointer from as_ptr guaranteed to be aligned to T Read more

The number of elements that it is valid to write to this Storage Read more

Returns a pointer to the first element

Returns a mutable pointer to the first element

Reserves space for at least new_capacity elements Read more

Tries to reserve space for at least new_capacity elements Read more

Creates a new storage with at least the given storage capacity

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.