Struct luminance::buffer::Buffer [] [src]

pub struct Buffer<T> { /* fields omitted */ }

A Buffer is a GPU region you can picture as an array. It has a static size and cannot be resized. The size is expressed in number of elements lying in the buffer, not in bytes.

Methods

impl<T> Buffer<T>
[src]

Create a new Buffer with a given number of elements.

Get the length of the buffer.

Retrieve an element from the Buffer.

Checks boundaries.

Retrieve the whole content of the Buffer.

Set a value at a given index in the Buffer.

Checks boundaries.

Write a whole slice into a buffer.

If the slice you pass in as less items than the length of the buffer, you’ll get a BufferError::TooFewValues. If it has more, you’ll get BufferError::TooManyValues.

In all cases, the copy will be performed and clamped to reasonable length.

Fill the Buffer with a single value.

Fill the whole buffer with an array.

Create a new buffer from its raw representation.

This function is unsafe becomes it assumes that the representation is compliant to the type you want it to be.

Convert a buffer to its raw representation.

Methods from Deref<Target=RawBuffer>

Obtain an immutable slice view into the buffer.

Obtain a mutable slice view into the buffer.

Trait Implementations

impl<T: Debug> Debug for Buffer<T>
[src]

Formats the value using the given formatter.

impl<T> Deref for Buffer<T>
[src]

The resulting type after dereferencing

The method called to dereference a value

impl<T> DerefMut for Buffer<T>
[src]

The method called to mutably dereference a value

impl<T> Drop for Buffer<T>
[src]

A method called when the value goes out of scope. Read more