Struct vulkano::buffer::BufferSlice [] [src]

pub struct BufferSlice<'a, T: ?Sized, B: 'a> { /* fields omitted */ }

A subpart of a buffer.

This object doesn't correspond to any Vulkan object. It exists for API convenience.

Example

Creating a slice:

use vulkano::buffer::BufferSlice;
                                                        unsafe { std::mem::uninitialized() };
let _slice = BufferSlice::from(&buffer);Run

Selecting a slice of a buffer that contains [T]:

use vulkano::buffer::BufferSlice;
                                                        unsafe { std::mem::uninitialized() };
let _slice = BufferSlice::from(&buffer).slice(12 .. 14).unwrap();Run

Methods

impl<'a, T: ?Sized, B: 'a> BufferSlice<'a, T, B>
[src]

Returns the buffer that this slice belongs to.

Returns the offset of that slice within the buffer.

Returns the size of that slice in bytes.

Builds a slice that contains an element from inside the buffer.

This method builds an object that represents a slice of the buffer. No actual operation is performed.

Example

TODO

Safety

The object whose reference is passed to the closure is uninitialized. Therefore you must not access the content of the object.

You must return a reference to an element from the parameter. The closure must not panic.

impl<'a, T, B: 'a> BufferSlice<'a, [T], B>
[src]

Returns the number of elements in this slice.

Reduces the slice to just one element of the array.

Returns None if out of range.

Reduces the slice to just a range of the array.

Returns None if out of range.

Trait Implementations

impl<'a, T: Clone + ?Sized, B: Clone + 'a> Clone for BufferSlice<'a, T, B>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<'a, T: ?Sized, B: 'a> From<&'a Arc<B>> for BufferSlice<'a, T, B> where B: TypedBuffer<Content=T>, T: 'static
[src]

Performs the conversion.

impl<'a, T, B: 'a> From<BufferSlice<'a, T, B>> for BufferSlice<'a, [T], B> where T: 'static
[src]

Performs the conversion.