Trait vulkano::buffer::BufferContents
source · [−]pub unsafe trait BufferContents: Send + Sync + 'static {
fn as_bytes(&self) -> &[u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
;
fn from_bytes(bytes: &[u8]) -> Result<&Self, PodCastError>;
fn from_bytes_mut(bytes: &mut [u8]) -> Result<&mut Self, PodCastError>;
fn size_of_element() -> DeviceSize;
}
Expand description
Trait for types of data that can be put in a buffer. These can be safely transmuted to and from a slice of bytes.
Required Methods
Converts an immutable reference to Self
to an immutable byte slice.
sourcefn from_bytes(bytes: &[u8]) -> Result<&Self, PodCastError>
fn from_bytes(bytes: &[u8]) -> Result<&Self, PodCastError>
Converts an immutable byte slice into an immutable reference to Self
.
sourcefn from_bytes_mut(bytes: &mut [u8]) -> Result<&mut Self, PodCastError>
fn from_bytes_mut(bytes: &mut [u8]) -> Result<&mut Self, PodCastError>
Converts a mutable byte slice into a mutable reference to Self
.
sourcefn size_of_element() -> DeviceSize
fn size_of_element() -> DeviceSize
Returns the size of an element of the type.