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
type Access: BufferAccess
Object that represents a GPU access to the buffer.
Required Methods
fn access(self) -> Self::Access
Builds an object that represents a GPU access to the buffer.
fn size(&self) -> usize
Returns the size of the buffer in bytes.
Provided Methods
fn len(&self) -> usize where
Self: TypedBuffer,
Self::Content: Content,
Self: TypedBuffer,
Self::Content: Content,
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.
fn slice<T>(self, range: Range<usize>) -> Option<BufferSlice<[T], Self>> where
Self: Sized + TypedBuffer<Content = [T]>,
Self: Sized + TypedBuffer<Content = [T]>,
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.
fn into_buffer_slice(self) -> BufferSlice<Self::Content, Self> where
Self: Sized + TypedBuffer,
Self: Sized + TypedBuffer,
Builds a BufferSlice
object holding the buffer by value.
fn index<T>(self, index: usize) -> Option<BufferSlice<[T], Self>> where
Self: Sized + TypedBuffer<Content = [T]>,
Self: Sized + TypedBuffer<Content = [T]>,
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
impl<T: ?Sized, A> Buffer for Arc<CpuAccessibleBuffer<T, A>> where
T: 'static + Send + Sync,
A: MemoryPool,impl<T: ?Sized, A> Buffer for CpuBufferPoolSubbuffer<T, A> where
A: MemoryPool,impl<T: ?Sized, A> Buffer for Arc<DeviceLocalBuffer<T, A>> where
T: 'static + Send + Sync,
A: MemoryPool + 'static,impl<T: ?Sized, A> Buffer for Arc<ImmutableBuffer<T, A>>
impl<T: ?Sized, A> Buffer for ImmutableBufferInitialization<T, A>
impl<T: ?Sized, B> Buffer for BufferSlice<T, B> where
B: Buffer,