Struct peter_engine::graphics::ResizingBuffer
source · pub struct ResizingBuffer<T> {
pub label: String,
pub usage: BufferUsages,
pub buffer_and_len: Option<(Buffer, usize)>,
pub contents: Vec<T>,
}Fields§
§label: String§usage: BufferUsages§buffer_and_len: Option<(Buffer, usize)>The size of the buffer in bytes is std::mem::size_of::<T>() * len.
contents: Vec<T>Implementations§
source§impl<T> ResizingBuffer<T>
impl<T> ResizingBuffer<T>
pub fn update<'a>(&'a mut self, device: &Device, queue: &Queue) -> usize
pub fn get_slice<'a>(&'a self) -> Option<BufferSlice<'a>>
pub fn clear(&mut self)
pub fn push(&mut self, value: T)
pub fn append(&mut self, values: &mut Vec<T>)
pub fn len(&self) -> usize
Auto Trait Implementations§
impl<T> !RefUnwindSafe for ResizingBuffer<T>
impl<T> Send for ResizingBuffer<T>where
T: Send,
impl<T> Sync for ResizingBuffer<T>where
T: Sync,
impl<T> Unpin for ResizingBuffer<T>where
T: Unpin,
impl<T> !UnwindSafe for ResizingBuffer<T>
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.