Struct glium::buffer::BufferViewMutSlice
[−]
[src]
pub struct BufferViewMutSlice<'a, T: ?Sized> where T: Content {
// some fields omitted
}Represents a sub-part of a buffer.
Methods
impl<'a, T: ?Sized> BufferViewMutSlice<'a, T> where T: Content
fn get_size(&self) -> usize
Returns the size in bytes of this slice.
fn map(self) -> Mapping<'a, T>
Maps the buffer in memory for both reading and writing.
fn map_read(self) -> ReadMapping<'a, T>
Maps the buffer in memory for reading.
fn map_write(self) -> WriteMapping<'a, T>
Maps the buffer in memory for writing only.
fn write(&self, data: &T)
Uploads some data in this buffer.
Panic
Panics if the length of data is different from the length of this buffer.
fn invalidate(&self)
Invalidates the content of the slice. The data becomes undefined.
This operation is a no-op if the backend doesn't support it.
fn read(&self) -> Result<T, ReadError>
Reads the content of the buffer.
fn as_slice_any(self) -> BufferViewAnySlice<'a>
Builds a slice-any containing the whole subbuffer.
impl<'a, T> BufferViewMutSlice<'a, [T]> where [T]: Content, T: Copy + 'a
fn len(&self) -> usize
Returns the number of elements in this slice.
fn slice(self, range: Range<usize>) -> Option<BufferViewMutSlice<'a, [T]>>
Builds a subslice of this slice. Returns None if out of range.
impl<'a, T> BufferViewMutSlice<'a, [T]> where T: PixelValue + 'a
fn read_as_texture_1d<S>(&self) -> Result<S, ReadError> where S: Texture1dDataSink<T>
Reads the content of the buffer.