#[repr(C, packed(1))]pub struct DxMachineHeader {
pub magic: [u8; 2],
pub version: u8,
pub flags: u8,
}Expand description
DX-Machine file header (4 bytes)
Fields§
§magic: [u8; 2]Magic bytes: 0x5A 0x44 (“ZD” little-endian)
version: u8Format version (currently 0x01)
flags: u8Feature flags (see FLAG_* constants)
Implementations§
Source§impl DxMachineHeader
impl DxMachineHeader
Sourcepub const fn with_flags(flags: u8) -> Self
pub const fn with_flags(flags: u8) -> Self
Create header with specific flags
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self, HeaderError>
pub fn from_bytes(bytes: &[u8]) -> Result<Self, HeaderError>
Parse header from byte slice
Sourcepub fn validate(&self) -> Result<(), HeaderError>
pub fn validate(&self) -> Result<(), HeaderError>
Validate header
Sourcepub const fn has_intern_table(&self) -> bool
pub const fn has_intern_table(&self) -> bool
Check if intern table exists
Sourcepub const fn has_length_table(&self) -> bool
pub const fn has_length_table(&self) -> bool
Check if length table exists
Sourcepub fn set_has_heap(&mut self, value: bool)
pub fn set_has_heap(&mut self, value: bool)
Set heap flag
Sourcepub fn set_has_intern_table(&mut self, value: bool)
pub fn set_has_intern_table(&mut self, value: bool)
Set intern table flag
Sourcepub fn set_has_length_table(&mut self, value: bool)
pub fn set_has_length_table(&mut self, value: bool)
Set length table flag
Trait Implementations§
Source§impl Clone for DxMachineHeader
impl Clone for DxMachineHeader
Source§fn clone(&self) -> DxMachineHeader
fn clone(&self) -> DxMachineHeader
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DxMachineHeader
Source§impl Debug for DxMachineHeader
impl Debug for DxMachineHeader
Auto Trait Implementations§
impl Freeze for DxMachineHeader
impl RefUnwindSafe for DxMachineHeader
impl Send for DxMachineHeader
impl Sync for DxMachineHeader
impl Unpin for DxMachineHeader
impl UnsafeUnpin for DxMachineHeader
impl UnwindSafe for DxMachineHeader
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.