#[repr(C, packed(1))]pub struct Header {
pub signature: [u8; 64],
pub public_key: [u8; 32],
pub blake3: [u8; 32],
pub count: u32,
pub flags: HeaderFlags,
}Fields§
§signature: [u8; 64]NaCl signature of header data
public_key: [u8; 32]NaCl public key used to generate signature
blake3: [u8; 32]Blake3 sum of entry data
count: u32Count of Entry structs, which starts immediately after header struct
flags: HeaderFlagsGeneric flags contain data and entry struct properties
Implementations§
Source§impl Header
impl Header
Sourcepub fn new<'a>(
data: &'a [u8],
public_key: &PublicKey,
) -> Result<&'a Header, Error>
pub fn new<'a>( data: &'a [u8], public_key: &PublicKey, ) -> Result<&'a Header, Error>
Parse header from raw header data and verify using public key
Sourcepub unsafe fn new_unchecked(data: &[u8]) -> Result<&Header, Error>
pub unsafe fn new_unchecked(data: &[u8]) -> Result<&Header, Error>
Parse header from raw header data without verification
pub fn count(&self) -> u32
Sourcepub fn entries_size(&self) -> Result<usize, Error>
pub fn entries_size(&self) -> Result<usize, Error>
Retrieve the size of the entries
Sourcepub fn total_size(&self) -> Result<usize, Error>
pub fn total_size(&self) -> Result<usize, Error>
Retrieve the size of the Header and its entries
Trait Implementations§
impl Copy for Header
impl Pod for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnsafeUnpin for Header
impl UnwindSafe for Header
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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
Source§type Bits = T
type Bits = T
Self must have the same layout as the specified Bits except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern.Source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self.