Struct wgpu_async::AsyncBuffer
source · pub struct AsyncBufferwhere
Self: Send,{ /* private fields */ }
Expand description
A wrapper around a wgpu::Buffer
which shadows some methods to allow for async
mapping using Rust’s async
API.
Implementations§
source§impl AsyncBuffer
impl AsyncBuffer
sourcepub fn slice<'a, S: RangeBounds<BufferAddress>>(
&'a self,
bounds: S
) -> AsyncBufferSlice<'a>
pub fn slice<'a, S: RangeBounds<BufferAddress>>( &'a self, bounds: S ) -> AsyncBufferSlice<'a>
Takes a slice of this buffer, in the same way a call to wgpu::Buffer::slice
would,
except wraps the result in an AsyncBufferSlice
so that the map_async
method can be
awaited.
Methods from Deref<Target = Buffer>§
sourcepub fn as_entire_binding(&self) -> BindingResource<'_>
pub fn as_entire_binding(&self) -> BindingResource<'_>
Return the binding view of the entire buffer.
sourcepub fn as_entire_buffer_binding(&self) -> BufferBinding<'_>
pub fn as_entire_buffer_binding(&self) -> BufferBinding<'_>
Return the binding view of the entire buffer.
sourcepub fn slice<S>(&self, bounds: S) -> BufferSlice<'_>where
S: RangeBounds<u64>,
pub fn slice<S>(&self, bounds: S) -> BufferSlice<'_>where S: RangeBounds<u64>,
Use only a portion of this Buffer for a given operation. Choosing a range with no end will use the rest of the buffer. Using a totally unbounded range will use the entire buffer.
sourcepub fn unmap(&self)
pub fn unmap(&self)
Flushes any pending write operations and unmaps the buffer from host memory.
Trait Implementations§
source§impl<T> AsMut<T> for AsyncBufferwhere
<AsyncBuffer as Deref>::Target: AsMut<T>,
impl<T> AsMut<T> for AsyncBufferwhere <AsyncBuffer as Deref>::Target: AsMut<T>,
source§impl<T> AsRef<T> for AsyncBufferwhere
T: ?Sized,
<AsyncBuffer as Deref>::Target: AsRef<T>,
impl<T> AsRef<T> for AsyncBufferwhere T: ?Sized, <AsyncBuffer as Deref>::Target: AsRef<T>,
source§impl Debug for AsyncBufferwhere
Self: Send,
impl Debug for AsyncBufferwhere Self: Send,
source§impl Deref for AsyncBuffer
impl Deref for AsyncBuffer
Auto Trait Implementations§
impl !RefUnwindSafe for AsyncBuffer
impl Send for AsyncBuffer
impl Sync for AsyncBuffer
impl Unpin for AsyncBuffer
impl !UnwindSafe for AsyncBuffer
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