Struct glin::SharedBuffer [−][src]
pub struct SharedBuffer<T> { /* fields omitted */ }
Wrapper around a Buffer with internal reference counting
Useful for example when the same buffer or ranges of the same buffer are to be used in different VAOs
Implementations
impl<T: 'static> SharedBuffer<T>
[src]
impl<T: 'static> SharedBuffer<T>
[src]pub fn load(&mut self, data: &[T], usage: GLenum)
[src]
pub fn load_target(&mut self, data: &[T], usage: GLenum, target: GLenum)
[src]
Loads the passed data into the buffer (re)allocating it to an specific target
see: gl(Named)BufferData
pub fn reserve(&mut self, len: usize, usage: GLenum)
[src]
Reserves len amount of memory into the buffer (re)allocating it
see: gl(Named)BufferData
pub fn reserve_target(&mut self, len: usize, usage: GLenum, target: GLenum)
[src]
Reserves len amount of memory into the buffer (re)allocating it to an specific target
see: gl(Named)BufferData
pub fn update(&mut self, data: &[T])
[src]
pub fn with_map_read<F: FnMut(&[T])>(
&self,
flags: MapReadFlags,
f: F
) -> Result<()>
[src]
&self,
flags: MapReadFlags,
f: F
) -> Result<()>
pub unsafe fn map_write<F: FnMut(&mut [T])>(
&mut self,
flags: MapWriteFlags,
f: F
) -> Result<()>
[src]
&mut self,
flags: MapWriteFlags,
f: F
) -> Result<()>
Unsafe cause reading from the mutable slice is undefined behaviour
pub fn map_read_write<F: FnMut(&mut [T])>(
&mut self,
flags: MapReadWriteFlags,
f: F
) -> Result<()>
[src]
&mut self,
flags: MapReadWriteFlags,
f: F
) -> Result<()>
pub fn copy_to<U, B: BufferRange<U> + WithBackendMut>(&self, dst: &mut B)
[src]
pub fn len(&self) -> usize
[src]
pub fn is_empty(&self) -> bool
[src]
pub fn capacity(&self) -> usize
[src]
pub fn bytes(&self) -> usize
[src]
pub fn capacity_bytes(&self) -> usize
[src]
pub fn id(&self) -> GLuint
[src]
pub fn stride(&self) -> usize
[src]
pub fn range<R: InputRange>(
&self,
range: R
) -> Range<T, SharedBuffer<T>, SharedBuffer<T>>
[src]
&self,
range: R
) -> Range<T, SharedBuffer<T>, SharedBuffer<T>>
pub fn range_mut<R: InputRange>(
&mut self,
range: R
) -> Range<T, SharedBuffer<T>, SharedBuffer<T>>
[src]
&mut self,
range: R
) -> Range<T, SharedBuffer<T>, SharedBuffer<T>>
Get a mutable range from the buffer
Useful to do operations on portions of the buffer
Panics if the range is out of bounds
impl SharedBuffer<u8>
[src]
impl SharedBuffer<u8>
[src]pub fn cast<T>(self) -> SharedBuffer<T>
[src]
Trait Implementations
impl<T: 'static> BufferRange<T> for SharedBuffer<T>
[src]
impl<T: 'static> BufferRange<T> for SharedBuffer<T>
[src]impl<'a, T: 'static> BufferRange<T> for &SharedBuffer<T>
[src]
impl<'a, T: 'static> BufferRange<T> for &SharedBuffer<T>
[src]impl<T: 'static> BufferRangeMut<T> for SharedBuffer<T>
[src]
impl<T: 'static> BufferRangeMut<T> for SharedBuffer<T>
[src]impl<T: 'static> Cast<T> for SharedBuffer<u8>
[src]
impl<T: 'static> Cast<T> for SharedBuffer<u8>
[src]type CastTo = SharedBuffer<T>
fn cast(self) -> SharedBuffer<T>
[src]
impl<T> Clone for SharedBuffer<T>
[src]
impl<T> Clone for SharedBuffer<T>
[src]fn clone(&self) -> SharedBuffer<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T: 'static> From<Buffer<T>> for SharedBuffer<T>
[src]
impl<T: 'static> From<Buffer<T>> for SharedBuffer<T>
[src]fn from(buffer: Buffer<T>) -> SharedBuffer<T>
[src]
impl<'a, T> MapRange<T> for SharedBuffer<T>
[src]
impl<'a, T> MapRange<T> for SharedBuffer<T>
[src]fn map_range_read(
&mut self,
offset: usize,
length: usize,
flags: MapReadFlags
) -> Result<MapRead<'_, T, Self>>
[src]
&mut self,
offset: usize,
length: usize,
flags: MapReadFlags
) -> Result<MapRead<'_, T, Self>>
impl<'a, T> MapRangeMut<T> for SharedBuffer<T>
[src]
impl<'a, T> MapRangeMut<T> for SharedBuffer<T>
[src]fn map_range_write(
&mut self,
offset: usize,
length: usize,
flags: MapWriteFlags
) -> Result<MapWrite<'_, T, Self>>
[src]
&mut self,
offset: usize,
length: usize,
flags: MapWriteFlags
) -> Result<MapWrite<'_, T, Self>>
fn map_range_read_write(
&mut self,
offset: usize,
length: usize,
flags: MapReadWriteFlags
) -> Result<MapReadWrite<'_, T, Self>>
[src]
&mut self,
offset: usize,
length: usize,
flags: MapReadWriteFlags
) -> Result<MapReadWrite<'_, T, Self>>
impl<T: PartialEq> PartialEq<SharedBuffer<T>> for SharedBuffer<T>
[src]
impl<T: PartialEq> PartialEq<SharedBuffer<T>> for SharedBuffer<T>
[src]fn eq(&self, other: &SharedBuffer<T>) -> bool
[src]
fn ne(&self, other: &SharedBuffer<T>) -> bool
[src]
impl<T: 'static> TypedBuffer<T> for SharedBuffer<T>
[src]
impl<T: 'static> TypedBuffer<T> for SharedBuffer<T>
[src]fn id(&self) -> GLuint
[src]
fn len(&self) -> usize
[src]
fn capacity(&self) -> usize
[src]
fn with_map_read<F: FnMut(&[T])>(&self, flags: MapReadFlags, f: F) -> Result<()>
[src]
fn copy_to<U, B: BufferRange<U> + WithBackendMut>(&self, dst: &mut B)
[src]
unsafe fn unmap(&self)
[src]
fn is_empty(&self) -> bool
[src]
fn bytes(&self) -> usize
[src]
fn capacity_bytes(&self) -> usize
[src]
fn stride(&self) -> usize
[src]
impl<'a, T: 'static> TypedBuffer<T> for &SharedBuffer<T>
[src]
impl<'a, T: 'static> TypedBuffer<T> for &SharedBuffer<T>
[src]fn id(&self) -> GLuint
[src]
fn len(&self) -> usize
[src]
fn capacity(&self) -> usize
[src]
fn with_map_read<F: FnMut(&[T])>(&self, flags: MapReadFlags, f: F) -> Result<()>
[src]
fn copy_to<U, BB: BufferRange<U> + WithBackendMut>(&self, dst: &mut BB) where
Self: Sized,
[src]
Self: Sized,
unsafe fn unmap(&self)
[src]
fn is_empty(&self) -> bool
[src]
fn bytes(&self) -> usize
[src]
fn capacity_bytes(&self) -> usize
[src]
fn stride(&self) -> usize
[src]
impl<'a, T: 'static> TypedBufferMut<T> for SharedBuffer<T>
[src]
impl<'a, T: 'static> TypedBufferMut<T> for SharedBuffer<T>
[src]unsafe fn with_map_write<F: FnMut(&mut [T])>(
&mut self,
flags: MapWriteFlags,
f: F
) -> Result<()>
[src]
&mut self,
flags: MapWriteFlags,
f: F
) -> Result<()>
fn with_map_read_write<F: FnMut(&mut [T])>(
&mut self,
flags: MapReadWriteFlags,
f: F
) -> Result<()>
[src]
&mut self,
flags: MapReadWriteFlags,
f: F
) -> Result<()>
impl<T> WithBackend for SharedBuffer<T>
[src]
impl<T> WithBackend for SharedBuffer<T>
[src]fn with_backend<F: FnMut(&dyn Backend) -> R, R>(&self, f: F) -> R
[src]
impl<T> WithBackendMut for SharedBuffer<T>
[src]
impl<T> WithBackendMut for SharedBuffer<T>
[src]fn with_backend_mut<F: FnMut(&mut dyn Backend) -> R, R>(&mut self, f: F) -> R
[src]
impl<T> WithMapRange<T> for SharedBuffer<T>
[src]
impl<T> WithMapRange<T> for SharedBuffer<T>
[src]fn with_map_range_read<F: FnMut(&[T])>(
&self,
offset: usize,
length: usize,
flags: MapReadFlags,
f: F
) -> Result<()>
[src]
&self,
offset: usize,
length: usize,
flags: MapReadFlags,
f: F
) -> Result<()>
impl<T> WithMapRangeMut<T> for SharedBuffer<T>
[src]
impl<T> WithMapRangeMut<T> for SharedBuffer<T>
[src]unsafe fn with_map_range_write<F: FnMut(&mut [T])>(
&mut self,
offset: usize,
length: usize,
flags: MapWriteFlags,
f: F
) -> Result<()>
[src]
&mut self,
offset: usize,
length: usize,
flags: MapWriteFlags,
f: F
) -> Result<()>
fn with_map_range_read_write<F: FnMut(&mut [T])>(
&mut self,
offset: usize,
length: usize,
flags: MapReadWriteFlags,
f: F
) -> Result<()>
[src]
&mut self,
offset: usize,
length: usize,
flags: MapReadWriteFlags,
f: F
) -> Result<()>
impl<T: Eq> Eq for SharedBuffer<T>
[src]
impl<T> StructuralEq for SharedBuffer<T>
[src]
impl<T> StructuralPartialEq for SharedBuffer<T>
[src]
Auto Trait Implementations
impl<T> !RefUnwindSafe for SharedBuffer<T>
impl<T> !Send for SharedBuffer<T>
impl<T> !Sync for SharedBuffer<T>
impl<T> Unpin for SharedBuffer<T> where
T: Unpin,
T: Unpin,
impl<T> !UnwindSafe for SharedBuffer<T>
Blanket Implementations
impl<'a, B> AttributeBufferBinding for B where
B: BufferRange<u32> + ?Sized,
[src]
impl<'a, B> AttributeBufferBinding for B where
B: BufferRange<u32> + ?Sized,
[src]pub fn enable_for(&Self, &Vao, &mut State<'_>, &Capabilities)
[src]
pub fn disable_for(&Self, &Vao, &mut State<'_>, &Capabilities)
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]