pub enum Block {
Basic(Basic),
Unknown {
header: BlockHeader,
data: Vec<u8>,
},
}Expand description
DFD block, containing a header and a data blob.
The header describes the type of block, and the data blob contains the block’s contents.
Variants§
Basic(Basic)
“Basic” DFD block. This is what most KTX2 files contain.
Unknown
DFD block type unknown to the ktx2 crate. Use the header to determine if this is a relevant block type for your application.
Implementations§
Source§impl Block
impl Block
Sourcepub fn serialized_length(&self) -> usize
pub fn serialized_length(&self) -> usize
Number of bytes the serialized form of this block will take up,
including the BlockHeader.
Sourcepub fn to_bytes(&self, output: &mut [u8])
pub fn to_bytes(&self, output: &mut [u8])
Serializes this block to a given slice of bytes. The slice must be at least
serialized_length bytes long.
Trait Implementations§
impl Eq for Block
impl StructuralPartialEq for Block
Auto Trait Implementations§
impl Freeze for Block
impl RefUnwindSafe for Block
impl Send for Block
impl Sync for Block
impl Unpin for Block
impl UnsafeUnpin for Block
impl UnwindSafe for Block
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more