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/shared_box"
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 |
|---|---|---|
block |
alloc/block |
shared_box.dodo |
error |
alloc/error |
shared_box.dodo |
layout |
alloc/layout |
shared_box.dodo |
mem |
core/mem |
shared_box.dodo |
ptr |
core/ptr |
shared_box.dodo |
shared_arena |
alloc/shared_arena |
shared_box.dodo |
Box
Struct · Source
Multiple boxes/containers may each own a handle to one arena. Checked loans retain the arena and backing memory. T cannot contain borrows or Results.
pub struct Box<T> {
// Private implementation fields omitted.
}
Box.get
Function · Source
pub fn get(&self) -> &T
Box.get_mut
Function · Source
pub fn get_mut(&mut self) -> &mut T
Box.replace
Function · Source
pub fn replace(&mut self, value: T) -> T
Box.into_inner
Function · Source
pub fn into_inner(self) -> T
new
Function · Source
Failure destroys the value once. Allocator metadata is never exposed through any checked value reference and there is no callback inside allocate.
pub fn new<T>(allocator: shared_arena.Handle, value: T) -> Box<T>!error.AllocError from(allocator)