#[repr(C)]pub struct UrnaHeader {Show 14 fields
pub magic: [u8; 4],
pub version_major: u16,
pub version_minor: u16,
pub flags: u32,
pub embedding_dim: u32,
pub n_chunks: u64,
pub n_embeddings: u64,
pub file_size: u64,
pub section_table_offset: u64,
pub section_table_count: u64,
pub manifest_offset: u64,
pub manifest_size: u64,
pub header_checksum: [u8; 8],
pub reserved: [u8; 48],
}Fields§
§magic: [u8; 4]§version_major: u16§version_minor: u16§flags: u32§embedding_dim: u32§n_chunks: u64§n_embeddings: u64§file_size: u64§section_table_offset: u64§section_table_count: u64§manifest_offset: u64§manifest_size: u64§header_checksum: [u8; 8]§reserved: [u8; 48]Implementations§
Source§impl UrnaHeader
impl UrnaHeader
pub fn new( embedding_dim: u32, n_chunks: u64, n_embeddings: u64, file_size: u64, section_table_offset: u64, section_table_count: u64, manifest_offset: u64, manifest_size: u64, ) -> Self
pub fn compute_checksum(&mut self)
pub fn validate_checksum(&self) -> Result<()>
Sourcepub fn as_bytes(&self) -> &[u8] ⓘ
pub fn as_bytes(&self) -> &[u8] ⓘ
The exact on-disk bytes of this record (little-endian host only,
which is every supported target; see layout::tests).
Sourcepub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
pub fn as_bytes_mut(&mut self) -> &mut [u8] ⓘ
Mutable view over the on-disk bytes; from_bytes-style readers copy
a slice in here. Sound for any content because every field accepts
every bit pattern (Pod).
Trait Implementations§
Source§impl Clone for UrnaHeader
impl Clone for UrnaHeader
impl Copy for UrnaHeader
Source§impl Debug for UrnaHeader
impl Debug for UrnaHeader
Source§impl Default for UrnaHeader
impl Default for UrnaHeader
Source§impl PartialEq for UrnaHeader
impl PartialEq for UrnaHeader
impl Pod for UrnaHeader
impl StructuralPartialEq for UrnaHeader
Auto Trait Implementations§
impl Freeze for UrnaHeader
impl RefUnwindSafe for UrnaHeader
impl Send for UrnaHeader
impl Sync for UrnaHeader
impl Unpin for UrnaHeader
impl UnsafeUnpin for UrnaHeader
impl UnwindSafe for UrnaHeader
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.