pub struct BufferData<'data, U = DynamicBufferUsages> { /* private fields */ }Implementations§
Source§impl<'data> BufferData<'data, BufferNoUsages>
impl<'data> BufferData<'data, BufferNoUsages>
Source§impl<'data, U> BufferData<'data, U>
impl<'data, U> BufferData<'data, U>
Sourcepub fn read(self) -> BufferData<'data, U::Out>where
U: Use<dyn Read>,
pub fn read(self) -> BufferData<'data, U::Out>where
U: Use<dyn Read>,
Enables the read usage.
This allows the buffer to be used for reading. Compile-time enforcement ensures the correct usage is present.
Sourcepub fn write(self) -> BufferData<'data, U::Out>where
U: Use<dyn Write>,
pub fn write(self) -> BufferData<'data, U::Out>where
U: Use<dyn Write>,
Enables the write usage.
This allows the buffer to be used for writing. Compile-time enforcement ensures the correct usage is present.
Sourcepub fn copy_from(self) -> BufferData<'data, U::Out>where
U: Use<dyn CopyFrom>,
pub fn copy_from(self) -> BufferData<'data, U::Out>where
U: Use<dyn CopyFrom>,
Enables the copy from usage.
This allows the buffer to be used for coping from it. Compile-time enforcement ensures the correct usage is present.
Sourcepub fn copy_to(self) -> BufferData<'data, U::Out>where
U: Use<dyn CopyTo>,
pub fn copy_to(self) -> BufferData<'data, U::Out>where
U: Use<dyn CopyTo>,
Enables the copy to usage.
This allows the buffer to be used for coping to it. Compile-time enforcement ensures the correct usage is present.
Sourcepub fn erase(self) -> BufferData<'data>where
U: BufferUsages,
pub fn erase(self) -> BufferData<'data>where
U: BufferUsages,
Erases the static type information about usages.
The full static type of a buffer includes information about all of its usages,
for example: Buffer<MapRead<true>>.
This enables compile-time checks for required usages - for example,
you won’t be able to read from a buffer without the read usage.
However, this strict typing significantly complicates type management.
As a compromise, you can call this method to erase usage information from the type, which moves the checks to runtime instead. In this case, using the buffer in a context where the required usage is missing will cause a panic.