Trait vulkano::buffer::Buffer [] [src]

pub unsafe trait Buffer {
    type Access: BufferAccess;
    fn access(self) -> Self::Access;
    fn size(&self) -> usize;

    fn len(&self) -> usize
    where
        Self: TypedBuffer,
        Self::Content: Content
, { ... } fn slice<T>(self, range: Range<usize>) -> Option<BufferSlice<[T], Self>>
    where
        Self: Sized + TypedBuffer<Content = [T]>
, { ... } fn into_buffer_slice(self) -> BufferSlice<Self::Content, Self>
    where
        Self: Sized + TypedBuffer
, { ... } fn index<T>(self, index: usize) -> Option<BufferSlice<[T], Self>>
    where
        Self: Sized + TypedBuffer<Content = [T]>
, { ... } }

Trait for objects that represent either a buffer or a slice of a buffer.

See also TypedBuffer.

Associated Types

Object that represents a GPU access to the buffer.

Required Methods

Builds an object that represents a GPU access to the buffer.

Returns the size of the buffer in bytes.

Provided Methods

Returns the length of the buffer in number of elements.

This method can only be called for buffers whose type is known to be an array.

Builds a BufferSlice object holding part of the buffer.

This method can only be called for buffers whose type is known to be an array.

This method can be used when you want to perform an operation on some part of the buffer and not on the whole buffer.

Returns None if out of range.

Builds a BufferSlice object holding the buffer by value.

Builds a BufferSlice object holding part of the buffer.

This method can only be called for buffers whose type is known to be an array.

This method can be used when you want to perform an operation on a specific element of the buffer and not on the whole buffer.

Returns None if out of range.

Implementors