pub struct SceneHeader {
pub magic_bytes: [u8; 8],
pub format_version: u8,
pub strategy_id: [u8; 32],
pub payload_length: u64,
}Expand description
The fixed-size header at the beginning of every Khora scene file.
Fields§
§magic_bytes: [u8; 8]Magic bytes to identify the file type, must be HEADER_MAGIC_BYTES.
format_version: u8The version of the header format itself.
strategy_id: [u8; 32]A null-padded UTF-8 string identifying the serialization strategy used. e.g., “KH_RECIPE_V1”, “KH_ARCHETYPE_V1”.
payload_length: u64The length of the payload data that follows this header, in bytes.
Implementations§
Source§impl SceneHeader
impl SceneHeader
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, &'static str>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, &'static str>
Attempts to parse a SceneHeader from the beginning of a byte slice.
Trait Implementations§
Source§impl Clone for SceneHeader
impl Clone for SceneHeader
Source§fn clone(&self) -> SceneHeader
fn clone(&self) -> SceneHeader
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SceneHeader
impl Debug for SceneHeader
Source§impl PartialEq for SceneHeader
impl PartialEq for SceneHeader
impl Eq for SceneHeader
impl StructuralPartialEq for SceneHeader
Auto Trait Implementations§
impl Freeze for SceneHeader
impl RefUnwindSafe for SceneHeader
impl Send for SceneHeader
impl Sync for SceneHeader
impl Unpin for SceneHeader
impl UnwindSafe for SceneHeader
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