#[repr(C)]pub struct Header {Show 78 fields
pub magic: [u8; 4],
pub version: u32,
pub crate_name_offset: u32,
pub crate_version_offset: u32,
pub string_pool_offset: u64,
pub string_pool_len: u64,
pub files_offset: u64,
pub files_count: u32,
pub unit_key_offset: u32,
pub defs_offset: u64,
pub defs_count: u32,
pub generation_offset: u32,
pub defs_by_hash_offset: u64,
pub defs_by_hash_count: u32,
pub _pad2: u32,
pub refs_offset: u64,
pub refs_count: u32,
pub _pad3: u32,
pub refs_by_target_offset: u64,
pub refs_by_target_count: u32,
pub _pad4: u32,
pub types_offset: u64,
pub types_count: u32,
pub _pad5: u32,
pub defs_by_owner_offset: u64,
pub defs_by_owner_count: u32,
pub _pad6: u32,
pub derefs_offset: u64,
pub derefs_count: u32,
pub _pad7: u32,
pub notes_offset: u64,
pub notes_count: u32,
pub _pad8: u32,
pub ty_defs_offset: u64,
pub ty_defs_count: u32,
pub _pad9: u32,
pub ty_entries_offset: u64,
pub ty_entries_count: u32,
pub _pad10: u32,
pub ty_bounds_offset: u64,
pub ty_bounds_count: u32,
pub _pad11: u32,
pub ty_args_offset: u64,
pub ty_args_count: u32,
pub _pad12: u32,
pub fn_sigs_offset: u64,
pub fn_sigs_count: u32,
pub _pad13: u32,
pub impls_offset: u64,
pub impls_count: u32,
pub _pad14: u32,
pub assoc_tys_offset: u64,
pub assoc_tys_count: u32,
pub _pad15: u32,
pub fields_offset: u64,
pub fields_count: u32,
pub _pad16: u32,
pub def_tys_offset: u64,
pub def_tys_count: u32,
pub _pad17: u32,
pub generic_params_offset: u64,
pub generic_params_count: u32,
pub _pad18: u32,
pub where_preds_offset: u64,
pub where_preds_count: u32,
pub _pad19: u32,
pub lang_items_offset: u64,
pub lang_items_count: u32,
pub _pad20: u32,
pub uses_offset: u64,
pub uses_count: u32,
pub _pad21: u32,
pub cfgs_offset: u64,
pub cfgs_count: u32,
pub target_offset: u32,
pub macro_defs_offset: u64,
pub macro_defs_count: u32,
pub _pad22: u32,
}Expand description
Fixed-size header at offset 0 of any .ridx file (format version 5, 416 bytes; v4 is 176, v3 is 160).
Fields§
§magic: [u8; 4]Magic signature (“RIDX”)
version: u32Format version (currently 5)
crate_name_offset: u32Offset in string pool for crate name
crate_version_offset: u32Offset in string pool for crate version
string_pool_offset: u64Offset of the string intern pool
string_pool_len: u64Length in bytes of the string intern pool
files_offset: u64Offset of the file path table (array of FileEntry)
files_count: u32§unit_key_offset: u32Offset in string pool for compilation unit key (or 0)
defs_offset: u64Offset of the definitions table (array of DefEntry)
defs_count: u32§generation_offset: u32Offset in string pool for source snapshot generation (or 0)
defs_by_hash_offset: u64Offset of the definitions hash index (array of HashIndexEntry sorted by hash)
defs_by_hash_count: u32§_pad2: u32§refs_offset: u64Offset of the references table (array of RefEntry sorted by span)
refs_count: u32§_pad3: u32§refs_by_target_offset: u64Offset of the references-by-target hash index (array of HashIndexEntry sorted by target hash)
refs_by_target_count: u32§_pad4: u32§types_offset: u64Offset of the types table (array of TypeEntry sorted by span)
types_count: u32§_pad5: u32§defs_by_owner_offset: u64Offset of the definitions-by-owner table (array of OwnerIndexEntry sorted by hash)
defs_by_owner_count: u32§_pad6: u32§derefs_offset: u64Offset of the deref mapping table (array of DerefEntry sorted by source_type_hash)
derefs_count: u32§_pad7: u32§notes_offset: u64Offset of the notes table (array of NoteEntry sorted by span); version 4.
notes_count: u32§_pad8: u32§ty_defs_offset: u64Offset of the TyArena definition table (TyDefEntry); version 5.
ty_defs_count: u32§_pad9: u32§ty_entries_offset: u64Offset of the TyArena interned type table (TyEntry); version 5.
ty_entries_count: u32§_pad10: u32§ty_bounds_offset: u64Offset of the TyArena trait bound table (TyBoundEntry); version 5.
ty_bounds_count: u32§_pad11: u32§ty_args_offset: u64Offset of the TyArena packed generic argument pool (u32); version 5.
ty_args_count: u32§_pad12: u32§fn_sigs_offset: u64Offset of the structured FnSigEntry table (sorted by def_index); version 5.
fn_sigs_count: u32§_pad13: u32§impls_offset: u64Offset of the structured ImplEntry table (sorted by simplified_self); version 5.
impls_count: u32§_pad14: u32§assoc_tys_offset: u64Offset of the AssocTyEntry table (contiguous per ImplEntry); version 5.
assoc_tys_count: u32§_pad15: u32§fields_offset: u64Offset of the FieldEntry table (sorted by (owner_def_index, field_idx)); version 5.
fields_count: u32§_pad16: u32§def_tys_offset: u64Offset of the DefTyEntry table (sorted by def_index); version 5.
def_tys_count: u32§_pad17: u32§generic_params_offset: u64Offset of the GenericParamEntry table (sorted by (owner_key, param_idx)); version 5.
generic_params_count: u32§_pad18: u32§where_preds_offset: u64Offset of the WherePredEntry table (sorted by owner_key); version 5.
where_preds_count: u32§_pad19: u32§lang_items_offset: u64Offset of the LangItemEntry table (sorted by kind); version 5.
lang_items_count: u32§_pad20: u32§uses_offset: u64Offset of the UseEntry table (sorted by (owner_raw, name_str)); version 5.
uses_count: u32§_pad21: u32§cfgs_offset: u64Offset of the CfgEntry table (sorted by (key_str, Option<val_str>)); version 5.
cfgs_count: u32§target_offset: u32Offset in string pool for effective target triple (or 0); version 5.
macro_defs_offset: u64Offset of the MacroDefEntry table (sorted by def_index); version 5.
macro_defs_count: u32§_pad22: u32Implementations§
Source§impl Header
impl Header
pub fn to_le(self) -> Self
pub fn from_le(self) -> Self
pub fn target_offset(&self) -> u32
pub fn unit_key_offset(&self) -> u32
pub fn generation_offset(&self) -> u32
Source§impl Header
impl Header
Sourcepub fn from_le_v4(bytes: &[u8]) -> Self
pub fn from_le_v4(bytes: &[u8]) -> Self
Decodes a version 4 header (176 bytes), zeroing the v5 TyArena section descriptors.
Sourcepub fn from_le_v3(bytes: &[u8]) -> Self
pub fn from_le_v3(bytes: &[u8]) -> Self
Decodes a version 3 header (160 bytes), zeroing notes and TyArena section descriptors.
Sourcepub fn from_le_v2(bytes: &[u8]) -> Self
pub fn from_le_v2(bytes: &[u8]) -> Self
Decodes a version 2 header (128 bytes), setting v3/v4/v5-specific table offsets and counts to 0.