[][src]Struct wgpu::Buffer

pub struct Buffer { /* fields omitted */ }

A handle to a GPU-accessible buffer.

Methods

impl Buffer[src]

pub fn map_read(
    &self,
    start: BufferAddress,
    size: BufferAddress
) -> impl Future<Output = Result<BufferReadMapping, BufferAsyncErr>>
[src]

Map the buffer for reading. The result is returned in a future.

For the future to complete, device.poll(...) must be called elsewhere in the runtime, possibly integrated into an event loop, run on a separate thread, or continually polled in the same task runtime that this future will be run on.

It's expected that wgpu will eventually supply its own event loop infrastructure that will be easy to integrate into other event loops, like winit's.

pub fn map_write(
    &self,
    start: BufferAddress,
    size: BufferAddress
) -> impl Future<Output = Result<BufferWriteMapping, BufferAsyncErr>>
[src]

Map the buffer for writing. The result is returned in a future.

See the documentation of (map_read)[#method.map_read] for more information about how to run this future.

pub fn unmap(&self)[src]

Flushes any pending write operations and unmaps the buffer from host memory.

Trait Implementations

impl Debug for Buffer[src]

impl Drop for Buffer[src]

impl PartialEq<Buffer> for Buffer[src]

impl StructuralPartialEq for Buffer[src]

Auto Trait Implementations

impl !RefUnwindSafe for Buffer

impl Send for Buffer

impl Sync for Buffer

impl Unpin for Buffer

impl UnwindSafe for Buffer

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.