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 has less items than the length of the buffer, you’ll get a BufferError::TooFewValues error. If it has more, you’ll get BufferError::TooManyValues.

This function won’t write anything on any error.

Fill the Buffer with a single value.

Fill the whole buffer with an array.

Convert a buffer to its raw representation.

Becareful: once you have called this function, it is not possible to go back to a Buffer<_>.

Obtain an immutable slice view into the buffer.

Obtain a mutable slice view into the buffer.

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> Deref for Buffer<T>
[src]

The resulting type after dereferencing.

Dereferences the value.

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

Mutably dereferences the value.

impl<T> From<Buffer<T>> for RawBuffer
[src]

Performs the conversion.

Auto Trait Implementations

impl<T> !Send for Buffer<T>

impl<T> !Sync for Buffer<T>