pub struct Allocation { /* private fields */ }
Expand description

A handle to an owned region of memory.

This handle does not dereference to a slice, since the underlying memory may have been created with Protection::NONE.

Implementations

Returns a pointer to the allocation’s base address.

The address is always aligned to the operating system’s page size.

Returns a mutable pointer to the allocation’s base address.

Returns two raw pointers spanning the allocation’s address space.

The returned range is half-open, which means that the end pointer points one past the last element of the allocation. This way, an empty allocation is represented by two equal pointers, and the difference between the two pointers represents the size of the allocation.

Returns two mutable raw pointers spanning the allocation’s address space.

Returns a range spanning the allocation’s address space.

Returns the size of the allocation in bytes.

The size is always aligned to a multiple of the operating system’s page size.

Trait Implementations

Executes the destructor for this type. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.