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 "std/process/alloc"
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 |
|---|---|---|
arena |
alloc/arena |
alloc.dodo |
bytes_alloc |
std/bytes_alloc |
alloc.dodo |
error |
alloc/error |
alloc.dodo |
process |
std/process |
alloc.dodo |
Error
Enum · Source
pub enum Error {
Allocation(error.AllocError),
Collection(process.CollectError)
}
Output
Struct · Source
pub struct Output<A, B> {
// Private implementation fields omitted.
}
Output.stdout
Function · Source
pub fn stdout(&self) -> &[u8]
Output.stderr
Function · Source
pub fn stderr(&self) -> &[u8]
Output.status
Function · Source
pub fn status(&self) -> &process.ExitStatus
collect
Function · Source
SAFETY: Both allocators meet std/bytes_alloc.new’s allocation/deallocation contract. Each is exclusively borrowed by its output buffer. No global allocator is consulted. Both bounds are allocated before touching the child. Allocation failure leaves the child live; collection failure reaps it and destroys both buffers (use caller-backed collect to retain failure prefixes).
pub unsafe fn collect<A, B>(child: &mut process.Child, stdout_allocator: &mut A,
stderr_allocator: &mut B, stdout_limit: usize, stderr_limit: usize,
timeout_ms: u64) -> Output<A, B>!Error from(stdout_allocator, stderr_allocator)
Requires an unsafe context. Follow the source safety preconditions and the linked guide before calling this API.
collect_arena
Function · Source
pub fn collect_arena(child: &mut process.Child, stdout_allocator: &mut arena.Arena,
stderr_allocator: &mut arena.Arena, stdout_limit: usize, stderr_limit: usize,
timeout_ms: u64) -> Output<arena.Arena, arena.Arena>!Error from(stdout_allocator, stderr_allocator)