Struct Magic
#[repr(transparent)]
pub struct Magic(/* private field */);
These values currently always take up a fixed four bytes, so we can parse and wrap them in this struct to enforce some small amount of type safety.
Implementations
impl Magic
const LOCAL_FILE_HEADER_SIGNATURE: Self = _;Local file header signature
const CENTRAL_DIRECTORY_HEADER_SIGNATURE: Self = _;Central directory header signature
const CENTRAL_DIRECTORY_END_SIGNATURE: Self = _;Central directory end signature
const CENTRAL_DIRECTORY_DIGITAL_SIGNATURE: Self = _;Optional central directory digital signature record
const ZIP64_CENTRAL_DIRECTORY_END_SIGNATURE: Self = _;Zip64 central directory signature
const ZIP64_CENTRAL_DIRECTORY_END_LOCATOR_SIGNATURE: Self = _;Zip64 central directory end locator signature
const DATA_DESCRIPTOR_SIGNATURE: Self = _;Data descriptor signature
const fn literal(x: u32) -> SelfCreate new literal
const fn from_le_bytes(bytes: [u8; 4]) -> SelfCreate new from bytes
const fn to_le_bytes(self) -> [u8; 4]Get as bytes
fn from_le(self) -> SelfFrom little endian
fn to_le(self) -> SelfTo little endian
Trait Implementations
impl Clone for Magic
fn clone(&self) -> Self
impl Copy for Magic
impl Debug for Magic
fn fmt(&self, f: &mut Formatter<'_>) -> Result
impl Eq for Magic
impl Hash for Magic
fn hash<__H: Hasher>(&self, state: &mut __H)
impl Ord for Magic
fn cmp(&self, other: &Self) -> Ordering
impl PartialEq for Magic
fn eq(&self, other: &Self) -> bool
impl PartialOrd for Magic
fn partial_cmp(&self, other: &Self) -> Option<Ordering>