Trait rin::gl::buffer::TypedBuffer [−][src]
pub trait TypedBuffer<T> { pub fn id(&self) -> u32; pub fn len(&self) -> usize; pub fn capacity(&self) -> usize; pub fn with_map_read<F>(
&self,
flags: MapReadFlags,
f: F
) -> Result<(), Error>
where
F: FnMut(&[T]); pub unsafe fn unmap(&self); pub fn copy_to<U, B>(&self, dst: &mut B)
where
B: BufferRange<U> + WithBackendMut; pub fn is_empty(&self) -> bool { ... } pub fn bytes(&self) -> usize { ... } pub fn capacity_bytes(&self) -> usize { ... } pub fn stride(&self) -> usize { ... } }
Buffer object with a type
Required methods
pub fn id(&self) -> u32
[src]
OpenGL id
pub fn len(&self) -> usize
[src]
Number of elements on the last update
pub fn capacity(&self) -> usize
[src]
Allocated capacity of the buffer in number of elements
pub fn with_map_read<F>(&self, flags: MapReadFlags, f: F) -> Result<(), Error> where
F: FnMut(&[T]),
[src]
F: FnMut(&[T]),
Maps a buffer object’s data store
Pass a closure that receives the mapped buffer to access it
see glMapBuffer
pub unsafe fn unmap(&self)
[src]
pub fn copy_to<U, B>(&self, dst: &mut B) where
B: BufferRange<U> + WithBackendMut,
[src]
B: BufferRange<U> + WithBackendMut,
Copy one buffer into another
Provided methods
pub fn is_empty(&self) -> bool
[src]
pub fn bytes(&self) -> usize
[src]
Total bytes on the last update
pub fn capacity_bytes(&self) -> usize
[src]
Total capcacity of the buffer in bytes
pub fn stride(&self) -> usize
[src]
Stride of the buffer type
Implementors
impl<'_, T> TypedBuffer<T> for &'_ SharedBufferStorage<T> where
T: 'static,
[src]
impl<'_, T> TypedBuffer<T> for &'_ SharedBufferStorage<T> where
T: 'static,
[src]pub fn id(&self) -> u32
[src]
pub fn len(&self) -> usize
[src]
pub fn capacity(&self) -> usize
[src]
pub fn with_map_read<F>(&self, flags: MapReadFlags, f: F) -> Result<(), Error> where
F: FnMut(&[T]),
[src]
F: FnMut(&[T]),
pub fn copy_to<U, B>(&self, dst: &mut B) where
B: BufferRange<U> + WithBackendMut,
[src]
B: BufferRange<U> + WithBackendMut,
pub unsafe fn unmap(&self)
[src]
impl<'a, '_, T> TypedBuffer<T> for &'_ Buffer<T> where
T: 'static,
[src]
impl<'a, '_, T> TypedBuffer<T> for &'_ Buffer<T> where
T: 'static,
[src]pub fn id(&self) -> u32
[src]
pub fn len(&self) -> usize
[src]
pub fn capacity(&self) -> usize
[src]
pub fn with_map_read<F>(&self, flags: MapReadFlags, f: F) -> Result<(), Error> where
F: FnMut(&[T]),
[src]
F: FnMut(&[T]),
pub fn copy_to<U, BB>(&self, dst: &mut BB) where
BB: BufferRange<U> + WithBackendMut,
&'_ Buffer<T>: Sized,
[src]
BB: BufferRange<U> + WithBackendMut,
&'_ Buffer<T>: Sized,
pub unsafe fn unmap(&self)
[src]
impl<'a, '_, T> TypedBuffer<T> for &'_ BufferStorage<T> where
T: 'static,
[src]
impl<'a, '_, T> TypedBuffer<T> for &'_ BufferStorage<T> where
T: 'static,
[src]pub fn id(&self) -> u32
[src]
pub fn len(&self) -> usize
[src]
pub fn capacity(&self) -> usize
[src]
pub fn with_map_read<F>(&self, flags: MapReadFlags, f: F) -> Result<(), Error> where
F: FnMut(&[T]),
[src]
F: FnMut(&[T]),
pub fn copy_to<U, BB>(&self, dst: &mut BB) where
BB: BufferRange<U> + WithBackendMut,
&'_ BufferStorage<T>: Sized,
[src]
BB: BufferRange<U> + WithBackendMut,
&'_ BufferStorage<T>: Sized,
pub unsafe fn unmap(&self)
[src]
impl<'a, '_, T> TypedBuffer<T> for &'_ SharedBuffer<T> where
T: 'static,
[src]
impl<'a, '_, T> TypedBuffer<T> for &'_ SharedBuffer<T> where
T: 'static,
[src]pub fn id(&self) -> u32
[src]
pub fn len(&self) -> usize
[src]
pub fn capacity(&self) -> usize
[src]
pub fn with_map_read<F>(&self, flags: MapReadFlags, f: F) -> Result<(), Error> where
F: FnMut(&[T]),
[src]
F: FnMut(&[T]),
pub fn copy_to<U, BB>(&self, dst: &mut BB) where
BB: BufferRange<U> + WithBackendMut,
&'_ SharedBuffer<T>: Sized,
[src]
BB: BufferRange<U> + WithBackendMut,
&'_ SharedBuffer<T>: Sized,
pub unsafe fn unmap(&self)
[src]
impl<'a, T> TypedBuffer<T> for Buffer<T> where
T: 'static,
[src]
impl<'a, T> TypedBuffer<T> for Buffer<T> where
T: 'static,
[src]pub fn id(&self) -> u32
[src]
pub fn len(&self) -> usize
[src]
pub fn capacity(&self) -> usize
[src]
pub fn with_map_read<F>(&self, flags: MapReadFlags, f: F) -> Result<(), Error> where
F: FnMut(&[T]),
[src]
F: FnMut(&[T]),
pub fn copy_to<U, BB>(&self, dst: &mut BB) where
BB: BufferRange<U> + WithBackendMut,
Buffer<T>: Sized,
[src]
BB: BufferRange<U> + WithBackendMut,
Buffer<T>: Sized,
pub unsafe fn unmap(&self)
[src]
impl<T> TypedBuffer<T> for BufferStorage<T> where
T: 'static,
[src]
impl<T> TypedBuffer<T> for BufferStorage<T> where
T: 'static,
[src]pub fn id(&self) -> u32
[src]
pub fn len(&self) -> usize
[src]
pub fn capacity(&self) -> usize
[src]
pub fn with_map_read<F>(&self, flags: MapReadFlags, f: F) -> Result<(), Error> where
F: FnMut(&[T]),
[src]
F: FnMut(&[T]),
pub fn copy_to<U, B>(&self, dst: &mut B) where
B: BufferRange<U> + WithBackendMut,
BufferStorage<T>: Sized,
[src]
B: BufferRange<U> + WithBackendMut,
BufferStorage<T>: Sized,
pub unsafe fn unmap(&self)
[src]
impl<T> TypedBuffer<T> for SharedBuffer<T> where
T: 'static,
[src]
impl<T> TypedBuffer<T> for SharedBuffer<T> where
T: 'static,
[src]pub fn id(&self) -> u32
[src]
pub fn len(&self) -> usize
[src]
pub fn capacity(&self) -> usize
[src]
pub fn with_map_read<F>(&self, flags: MapReadFlags, f: F) -> Result<(), Error> where
F: FnMut(&[T]),
[src]
F: FnMut(&[T]),
pub fn copy_to<U, B>(&self, dst: &mut B) where
B: BufferRange<U> + WithBackendMut,
[src]
B: BufferRange<U> + WithBackendMut,
pub unsafe fn unmap(&self)
[src]
impl<T> TypedBuffer<T> for SharedBufferStorage<T> where
T: 'static,
[src]
impl<T> TypedBuffer<T> for SharedBufferStorage<T> where
T: 'static,
[src]pub fn id(&self) -> u32
[src]
pub fn len(&self) -> usize
[src]
pub fn capacity(&self) -> usize
[src]
pub fn with_map_read<F>(&self, flags: MapReadFlags, f: F) -> Result<(), Error> where
F: FnMut(&[T]),
[src]
F: FnMut(&[T]),
pub fn copy_to<U, B>(&self, dst: &mut B) where
B: BufferRange<U> + WithBackendMut,
[src]
B: BufferRange<U> + WithBackendMut,
pub unsafe fn unmap(&self)
[src]
impl<T, B, BB> TypedBuffer<T> for Range<T, B, BB> where
B: TypedBuffer<T> + WithMapRange<T> + WithBackend,
T: 'static,
BB: Borrow<B>,
[src]
impl<T, B, BB> TypedBuffer<T> for Range<T, B, BB> where
B: TypedBuffer<T> + WithMapRange<T> + WithBackend,
T: 'static,
BB: Borrow<B>,
[src]pub fn id(&self) -> u32
[src]
pub fn len(&self) -> usize
[src]
pub fn capacity(&self) -> usize
[src]
pub fn with_map_read<F>(&self, flags: MapReadFlags, f: F) -> Result<(), Error> where
F: FnMut(&[T]),
[src]
F: FnMut(&[T]),
pub fn copy_to<U, BR>(&self, dst: &mut BR) where
BR: BufferRange<U> + WithBackendMut,
[src]
BR: BufferRange<U> + WithBackendMut,