Struct rin::gl::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> SharedBuffer<T> where
T: 'static,
[src]
impl<T> SharedBuffer<T> where
T: 'static,
[src]pub fn load(&mut self, data: &[T], usage: u32)
[src]
pub fn load_target(&mut self, data: &[T], usage: u32, target: u32)
[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: u32)
[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: u32, target: u32)
[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>(&self, flags: MapReadFlags, f: F) -> Result<(), Error> where
F: FnMut(&[T]),
[src]
F: FnMut(&[T]),
pub unsafe fn map_write<F>(
&mut self,
flags: MapWriteFlags,
f: F
) -> Result<(), Error> where
F: FnMut(&mut [T]),
[src]
&mut self,
flags: MapWriteFlags,
f: F
) -> Result<(), Error> where
F: FnMut(&mut [T]),
Unsafe cause reading from the mutable slice is undefined behaviour
pub fn map_read_write<F>(
&mut self,
flags: MapReadWriteFlags,
f: F
) -> Result<(), Error> where
F: FnMut(&mut [T]),
[src]
&mut self,
flags: MapReadWriteFlags,
f: F
) -> Result<(), Error> where
F: FnMut(&mut [T]),
pub fn copy_to<U, B>(&self, dst: &mut B) where
B: BufferRange<U> + WithBackendMut,
[src]
B: BufferRange<U> + WithBackendMut,
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) -> u32
[src]
pub fn stride(&self) -> usize
[src]
pub fn range<R>(&self, range: R) -> Range<T, SharedBuffer<T>, SharedBuffer<T>> where
R: InputRange,
[src]
R: InputRange,
pub fn range_mut<R>(
&mut self,
range: R
) -> Range<T, SharedBuffer<T>, SharedBuffer<T>> where
R: InputRange,
[src]
&mut self,
range: R
) -> Range<T, SharedBuffer<T>, SharedBuffer<T>> where
R: InputRange,
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<'a, '_, T> BufferRange<T> for &'_ SharedBuffer<T> where
T: 'static,
[src]
impl<'a, '_, T> BufferRange<T> for &'_ SharedBuffer<T> where
T: 'static,
[src]pub fn start(&self) -> usize
[src]
pub fn end(&self) -> usize
[src]
pub fn into_range<R>(
self,
range: R
) -> Range<T, &'_ SharedBuffer<T>, &'_ SharedBuffer<T>> where
R: InputRange,
&'_ SharedBuffer<T>: Sized,
[src]
self,
range: R
) -> Range<T, &'_ SharedBuffer<T>, &'_ SharedBuffer<T>> where
R: InputRange,
&'_ SharedBuffer<T>: Sized,
impl<T> BufferRange<T> for SharedBuffer<T> where
T: 'static,
[src]
impl<T> BufferRange<T> for SharedBuffer<T> where
T: 'static,
[src]pub fn start(&self) -> usize
[src]
pub fn end(&self) -> usize
[src]
pub fn into_range<R>(
self,
range: R
) -> Range<T, SharedBuffer<T>, SharedBuffer<T>> where
R: InputRange,
SharedBuffer<T>: Sized,
[src]
self,
range: R
) -> Range<T, SharedBuffer<T>, SharedBuffer<T>> where
R: InputRange,
SharedBuffer<T>: Sized,
impl<T> BufferRangeMut<T> for SharedBuffer<T> where
T: 'static,
[src]
impl<T> BufferRangeMut<T> for SharedBuffer<T> where
T: 'static,
[src]impl<T> Cast<T> for SharedBuffer<u8> where
T: 'static,
[src]
impl<T> Cast<T> for SharedBuffer<u8> where
T: 'static,
[src]type CastTo = SharedBuffer<T>
pub fn cast(self) -> SharedBuffer<T>
[src]
impl<T> Clone for SharedBuffer<T>
[src]
impl<T> Clone for SharedBuffer<T>
[src]pub fn clone(&self) -> SharedBuffer<T>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<T> Debug for SharedBuffer<T> where
T: Debug,
[src]
impl<T> Debug for SharedBuffer<T> where
T: Debug,
[src]impl<T> From<Buffer<T>> for SharedBuffer<T> where
T: 'static,
[src]
impl<T> From<Buffer<T>> for SharedBuffer<T> where
T: 'static,
[src]pub fn from(buffer: Buffer<T>) -> SharedBuffer<T>
[src]
impl InternalCreation<SharedBuffer<u8>> for Allocator<SharedBuffer<u8>>
[src]
impl InternalCreation<SharedBuffer<u8>> for Allocator<SharedBuffer<u8>>
[src]impl<'a, T> MapRange<T> for SharedBuffer<T>
[src]
impl<'a, T> MapRange<T> for SharedBuffer<T>
[src]pub fn map_range_read(
&mut self,
offset: usize,
length: usize,
flags: MapReadFlags
) -> Result<MapRead<'_, T, SharedBuffer<T>>, Error>
[src]
&mut self,
offset: usize,
length: usize,
flags: MapReadFlags
) -> Result<MapRead<'_, T, SharedBuffer<T>>, Error>
impl<'a, T> MapRangeMut<T> for SharedBuffer<T>
[src]
impl<'a, T> MapRangeMut<T> for SharedBuffer<T>
[src]pub fn map_range_write(
&mut self,
offset: usize,
length: usize,
flags: MapWriteFlags
) -> Result<MapWrite<'_, T, SharedBuffer<T>>, Error>
[src]
&mut self,
offset: usize,
length: usize,
flags: MapWriteFlags
) -> Result<MapWrite<'_, T, SharedBuffer<T>>, Error>
pub fn map_range_read_write(
&mut self,
offset: usize,
length: usize,
flags: MapReadWriteFlags
) -> Result<MapReadWrite<'_, T, SharedBuffer<T>>, Error>
[src]
&mut self,
offset: usize,
length: usize,
flags: MapReadWriteFlags
) -> Result<MapReadWrite<'_, T, SharedBuffer<T>>, Error>
impl<T> PartialEq<SharedBuffer<T>> for SharedBuffer<T> where
T: PartialEq<T>,
[src]
impl<T> PartialEq<SharedBuffer<T>> for SharedBuffer<T> where
T: PartialEq<T>,
[src]pub fn eq(&self, other: &SharedBuffer<T>) -> bool
[src]
pub fn ne(&self, other: &SharedBuffer<T>) -> bool
[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]
pub fn is_empty(&self) -> bool
[src]
pub fn bytes(&self) -> usize
[src]
pub fn capacity_bytes(&self) -> usize
[src]
pub fn stride(&self) -> usize
[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]
pub fn is_empty(&self) -> bool
[src]
pub fn bytes(&self) -> usize
[src]
pub fn capacity_bytes(&self) -> usize
[src]
pub fn stride(&self) -> usize
[src]
impl<'a, T> TypedBufferMut<T> for SharedBuffer<T> where
T: 'static,
[src]
impl<'a, T> TypedBufferMut<T> for SharedBuffer<T> where
T: 'static,
[src]pub unsafe fn with_map_write<F>(
&mut self,
flags: MapWriteFlags,
f: F
) -> Result<(), Error> where
F: FnMut(&mut [T]),
[src]
&mut self,
flags: MapWriteFlags,
f: F
) -> Result<(), Error> where
F: FnMut(&mut [T]),
pub fn with_map_read_write<F>(
&mut self,
flags: MapReadWriteFlags,
f: F
) -> Result<(), Error> where
F: FnMut(&mut [T]),
[src]
&mut self,
flags: MapReadWriteFlags,
f: F
) -> Result<(), Error> where
F: FnMut(&mut [T]),
impl<T> WithBackend for SharedBuffer<T>
[src]
impl<T> WithBackend for SharedBuffer<T>
[src]pub fn with_backend<F, R>(&self, f: F) -> R where
F: FnMut(&dyn Backend) -> R,
[src]
F: FnMut(&dyn Backend) -> R,
impl<T> WithBackendMut for SharedBuffer<T>
[src]
impl<T> WithBackendMut for SharedBuffer<T>
[src]pub fn with_backend_mut<F, R>(&mut self, f: F) -> R where
F: FnMut(&mut dyn Backend) -> R,
[src]
F: FnMut(&mut dyn Backend) -> R,
impl<T> WithMapRange<T> for SharedBuffer<T>
[src]
impl<T> WithMapRange<T> for SharedBuffer<T>
[src]pub fn with_map_range_read<F>(
&self,
offset: usize,
length: usize,
flags: MapReadFlags,
f: F
) -> Result<(), Error> where
F: FnMut(&[T]),
[src]
&self,
offset: usize,
length: usize,
flags: MapReadFlags,
f: F
) -> Result<(), Error> where
F: FnMut(&[T]),
impl<T> WithMapRangeMut<T> for SharedBuffer<T>
[src]
impl<T> WithMapRangeMut<T> for SharedBuffer<T>
[src]pub unsafe fn with_map_range_write<F>(
&mut self,
offset: usize,
length: usize,
flags: MapWriteFlags,
f: F
) -> Result<(), Error> where
F: FnMut(&mut [T]),
[src]
&mut self,
offset: usize,
length: usize,
flags: MapWriteFlags,
f: F
) -> Result<(), Error> where
F: FnMut(&mut [T]),
pub fn with_map_range_read_write<F>(
&mut self,
offset: usize,
length: usize,
flags: MapReadWriteFlags,
f: F
) -> Result<(), Error> where
F: FnMut(&mut [T]),
[src]
&mut self,
offset: usize,
length: usize,
flags: MapReadWriteFlags,
f: F
) -> Result<(), Error> where
F: FnMut(&mut [T]),
impl<T> BufferExt<T> for SharedBuffer<T> where
T: 'static,
[src]
T: 'static,
impl<T> Eq for SharedBuffer<T> where
T: Eq,
[src]
T: Eq,
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: &Vao,
gl: &mut State<'_>,
capabilities: &Capabilities
)
[src]
&self,
vao: &Vao,
gl: &mut State<'_>,
capabilities: &Capabilities
)
pub fn disable_for(
&self,
vao: &Vao,
gl: &mut State<'_>,
capabilities: &Capabilities
)
[src]
&self,
vao: &Vao,
gl: &mut State<'_>,
capabilities: &Capabilities
)
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]pub fn equivalent(&self, key: &K) -> bool
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
[src]pub fn to_subset(&self) -> Option<SS>
[src]
pub fn is_in_subset(&self) -> bool
[src]
pub fn to_subset_unchecked(&self) -> SS
[src]
pub fn from_subset(element: &SS) -> SP
[src]
impl<T, M> MapRange<T> for M where
M: WithMapRange<T>,
[src]
M: WithMapRange<T>,