IsBuffer

Trait IsBuffer 

Source
pub trait IsBuffer: Sized {
    type Resources<'a>: Clone;

    // Required methods
    fn buffer_create(resources: Self::Resources<'_>, capacity: usize) -> Self;
    fn buffer_copy(
        resources: Self::Resources<'_>,
        source_buffer: &Self,
        destination_buffer: &Self,
    );
    fn buffer_write<U: Iterator<Item = SlabUpdate>>(
        &self,
        resources: Self::Resources<'_>,
        updates: U,
    );
}

Required Associated Typesยง

Required Methodsยง

Source

fn buffer_create(resources: Self::Resources<'_>, capacity: usize) -> Self

Create a new buffer with the given capacity.

Source

fn buffer_copy( resources: Self::Resources<'_>, source_buffer: &Self, destination_buffer: &Self, )

Copy the contents of one buffer into another at index 0.

Source

fn buffer_write<U: Iterator<Item = SlabUpdate>>( &self, resources: Self::Resources<'_>, updates: U, )

Write updates to the buffer.

Dyn Compatibilityยง

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Typesยง

Sourceยง

impl IsBuffer for Mutex<Vec<u32>>

Sourceยง

type Resources<'a> = ()

Sourceยง

fn buffer_create((): Self::Resources<'_>, capacity: usize) -> Self

Sourceยง

fn buffer_copy( (): Self::Resources<'_>, source_buffer: &Self, destination_buffer: &Self, )

Sourceยง

fn buffer_write<U: Iterator<Item = SlabUpdate>>( &self, (): Self::Resources<'_>, updates: U, )

Sourceยง

impl IsBuffer for Buffer

Sourceยง

type Resources<'a> = (&'a Device, &'a Queue, Option<&'a str>, BufferUsages)

Sourceยง

fn buffer_write<U: Iterator<Item = SlabUpdate>>( &self, (_, queue, _, _): Self::Resources<'_>, updates: U, )

Sourceยง

fn buffer_create( (device, _, label, usages): Self::Resources<'_>, capacity: usize, ) -> Self

Sourceยง

fn buffer_copy( (device, queue, label, _): Self::Resources<'_>, source_buffer: &Self, destination_buffer: &Self, )

Implementorsยง