Crate buffer_trait

Source
Expand description

A Buffer trait for reading into uninitialized buffers.

This is a repo about the Buffer trait idea covered in a recent blog post.

rustix’s Buffer trait is sealed for now, for practical reasons, and not all of the ideas discussed in the post are implemented.

To illustrate the full Buffer idea, this repo contains a library with a fully public Buffer trait, and adds support for a safe interface for using Buffer.

Feedback is welcome! Nothing here is set in stone.

Structs§

Cursor
A cursor for safely writing into an uninitialized buffer.
SpareCapacityalloc
A type that implements Buffer by appending to a Vec, up to its capacity.

Traits§

Buffer
A memory buffer that may be uninitialized.

Functions§

spare_capacityalloc
Construct a SpareCapacity, which implements Buffer.