pub trait ByteStorage {
// Required methods
fn reset(&mut self);
fn bytes(&self) -> &[u8] ⓘ;
fn bytes_count(&self) -> usize;
fn write_bytes(&mut self, bytes: &[u8]);
fn write_zeros(&mut self, count: usize);
// Provided method
fn push_padding(&mut self, alignment: usize) { ... }
}Expand description
A trait for any storage suitable to store bytes for uniforms.
Required Methods§
Sourcefn bytes_count(&self) -> usize
fn bytes_count(&self) -> usize
Returns total number of bytes that is currently in the storage.
Sourcefn write_bytes(&mut self, bytes: &[u8])
fn write_bytes(&mut self, bytes: &[u8])
Writes the given number of bytes to the storage.
Sourcefn write_zeros(&mut self, count: usize)
fn write_zeros(&mut self, count: usize)
Writes the given number of zero bytes to the storage.
Provided Methods§
Sourcefn push_padding(&mut self, alignment: usize)
fn push_padding(&mut self, alignment: usize)
Writes zeros to ensure that the last byte in the storage has a position that is multiple with the given alignment. The alignment must be power of two.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".