Struct jenga::Frame [] [src]

pub struct Frame<'a> { /* fields omitted */ }

An allocation Frame.

Data can be allocated using:

  • place which allocates b bytes of type T and returns a mutable view to it.
  • place_raw if you really want unsafe code.
  • place_iter will drain the given iterator and return a mutable view to the data.
  • cursor gives you a gowing buffer that supports io::Write.
  • writer does the same, but supports fmt::Write and is can be turned into &str

All returned buffers are valid for the lifetime of the Frame.

Methods

impl<'a> Frame<'a>
[src]

Turn a slice of memory into an allocator Frame.

Allocate count elements of T. Returns OutOfMemory if there is not enough space left.

allocate count elements of T. panics if there is not enough space left.

Allocate count elements of T. Returns OutOfMemory if there is not enough space left. The caller has to ensure the data does not outlife the Frame

Allocate count elements of T. panics if there is not enough space left. The caller has to ensure the data does not outlife the Frame

Drain the provided Iterator and return the resulting data. The iterator may not use the stack allocator. panics if the iterator attempts to use the stack allocator.

Store something on the stack. To be used with the place syntax.

Create a subframe. All allocations that happen within it, will be reset when it goes out if scope.

Create a growing Buffer that supports io::Write call finish() on the buffer to complete it.

Create a growing Buffer that supports fmt::Write call finish() on the buffer to complete it.