pub struct Magic(/* private fields */);Expand description
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§
Source§impl Magic
impl Magic
Sourcepub const LOCAL_FILE_HEADER_SIGNATURE: Self
pub const LOCAL_FILE_HEADER_SIGNATURE: Self
Local file header signature
Sourcepub const CENTRAL_DIRECTORY_HEADER_SIGNATURE: Self
pub const CENTRAL_DIRECTORY_HEADER_SIGNATURE: Self
Central directory header signature
Sourcepub const CENTRAL_DIRECTORY_END_SIGNATURE: Self
pub const CENTRAL_DIRECTORY_END_SIGNATURE: Self
Central directory end signature
Sourcepub const ZIP64_CENTRAL_DIRECTORY_END_SIGNATURE: Self
pub const ZIP64_CENTRAL_DIRECTORY_END_SIGNATURE: Self
Zip64 central directory signature
Sourcepub const ZIP64_CENTRAL_DIRECTORY_END_LOCATOR_SIGNATURE: Self
pub const ZIP64_CENTRAL_DIRECTORY_END_LOCATOR_SIGNATURE: Self
Zip64 central directory end locator signature
Sourcepub const DATA_DESCRIPTOR_SIGNATURE: Self
pub const DATA_DESCRIPTOR_SIGNATURE: Self
Data descriptor signature
Sourcepub const fn from_le_bytes(bytes: [u8; 4]) -> Self
pub const fn from_le_bytes(bytes: [u8; 4]) -> Self
Create new from bytes
Sourcepub const fn to_le_bytes(self) -> [u8; 4]
pub const fn to_le_bytes(self) -> [u8; 4]
Get as bytes
Trait Implementations§
impl Copy for Magic
impl Eq for Magic
Source§impl Ord for Magic
impl Ord for Magic
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Magic
impl PartialOrd for Magic
impl StructuralPartialEq for Magic
Auto Trait Implementations§
impl Freeze for Magic
impl RefUnwindSafe for Magic
impl Send for Magic
impl Sync for Magic
impl Unpin for Magic
impl UnsafeUnpin for Magic
impl UnwindSafe for Magic
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.