Library guide · API index and notation
This page is generated from the bundled library in this checkout. Signatures and adjacent source comments are reproduced below; the linked guide explains usage, storage, failures, and platform support.
import "alloc/block"
Names used in signatures
Unqualified names denote this package’s types (including other source files in the same package), language built-ins, or generic parameters such as T. Qualified names use the import aliases below. These aliases belong to the library source; import a dependency yourself to use its alias in your program.
| Alias | Package | Source file |
|---|---|---|
layout |
alloc/layout |
block.dodo |
Block
Struct · Source
A raw allocation descriptor. Moving it does not release storage or destroy values. Its allocator and backing storage must outlive every pointer access. There is deliberately no clone: deallocation consumes the descriptor once.
pub struct Block {
// Private implementation fields omitted.
}
Block.from_raw_parts
Function · Source
SAFETY: pointer is nonnull and aligned for allocation_layout. A nonzero allocation covers at least layout.size() writable, exclusively owned bytes. Zero-size pointers may dangle and must never be dereferenced. The caller establishes which allocator owns this allocation.
pub unsafe fn from_raw_parts(pointer: *mut u8, allocation_layout: layout.Layout) -> Block
Requires an unsafe context. Follow the source safety preconditions and the linked guide before calling this API.
Block.as_ptr
Function · Source
pub fn as_ptr(&self) -> *mut u8
Block.size
Function · Source
pub fn size(&self) -> usize
Block.align
Function · Source
pub fn align(&self) -> usize
Block.layout
Function · Source
pub fn layout(&self) -> &layout.Layout