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/io_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 |
|---|---|---|
bytes_alloc |
std/bytes_alloc |
io_alloc.dodo |
error |
alloc/error |
io_alloc.dodo |
io |
std/io |
io_alloc.dodo |
BufferWriter
Struct · Source
Allocation-dependent append writer. The buffer exclusively retains its allocator and limit; this adapter exclusively borrows the buffer. No global allocator or implicit ownership transfer is involved. Each write either appends every source byte or leaves the buffer unchanged on failure.
pub struct BufferWriter<A> {
// Private implementation fields omitted.
}
BufferWriter.new
Function · Source
pub fn new(buffer: &mut bytes_alloc.Buffer<A>) -> BufferWriter<A> from(buffer)
BufferWriter.write
Function · Source
pub fn write(&mut self, source: &[u8]) -> usize!io.Error
append_from
Function · Source
Append at most limit bytes, using caller scratch and the buffer’s explicit allocator/capacity policy. CopyError records consumed and appended counts; on allocation failure previously appended bytes remain owned by the buffer. Reaching limit succeeds without an extra read; report.eof then remains false.
pub fn append_from<R, A>(reader: &mut R, buffer: &mut bytes_alloc.Buffer<A>, scratch: &mut[u8], limit: usize) -> io.CopyReport!io.CopyError