pub struct Footer {
pub version: u32,
pub blocks: Vec<BlockMeta>,
pub arrays: Vec<ArrayMeta>,
pub attr_keys: Vec<String>,
pub attr_values: Vec<AttributeValue>,
pub overlay_index: u32,
pub base_file_hint: String,
}Expand description
The file footer containing the block table and array table.
Serialized with rkyv for zero-copy access to the archived form.
Fields§
§version: u32Format version.
blocks: Vec<BlockMeta>Block table: metadata for every block in the data region.
arrays: Vec<ArrayMeta>Array table: metadata for every array stored in the file.
attr_keys: Vec<String>Global dictionary of attribute key strings.
Array attributes reference keys by index into this vec, so each unique key string is stored exactly once regardless of how many arrays carry that attribute.
attr_values: Vec<AttributeValue>Global dictionary of attribute values.
Array attributes reference values by index into this vec, so each
distinct value is stored exactly once across all arrays. Together with
attr_keys this means each ArrayMeta::attributes entry is just 4
bytes (two u16 indices).
overlay_index: u32Position of this file in the overlay stack.
0 = base file. N > 0 = the Nth sidecar ({stem}.N.arrf).
A sidecar footer’s arrays list contains only the delta — arrays
and chunks that changed relative to lower layers.
base_file_hint: StringStem of the base .af file this sidecar belongs to.
Empty for base files. Used to validate that a sidecar was created for the correct base file when opening a layered file.
Implementations§
Sourcepub fn new_overlay(
overlay_index: u32,
base_file_hint: impl Into<String>,
) -> Self
pub fn new_overlay( overlay_index: u32, base_file_hint: impl Into<String>, ) -> Self
Creates a new empty overlay (sidecar) footer.
Sourcepub fn is_overlay(&self) -> bool
pub fn is_overlay(&self) -> bool
Returns true if this footer belongs to a sidecar file.
Sourcepub fn serialize(&self) -> Result<Vec<u8>>
pub fn serialize(&self) -> Result<Vec<u8>>
Serializes the footer to bytes, appending the trailer.
Layout: [rkyv_bytes][footer_size: u64 LE][MAGIC]
Sourcepub fn deserialize(data: &[u8]) -> Result<Self>
pub fn deserialize(data: &[u8]) -> Result<Self>
Deserializes a footer from bytes that include the trailer.
data must contain at least the trailer and the footer payload.
Trait Implementations§
Source§const COPY_OPTIMIZATION: CopyOptimization<Self>
const COPY_OPTIMIZATION: CopyOptimization<Self>
serialize. Read moreSource§type Archived = ArchivedFooter
type Archived = ArchivedFooter
Source§type Resolver = FooterResolver
type Resolver = FooterResolver
Auto Trait Implementations§
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
Source§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
Archive, it may be
unsized. Read moreSource§fn archived_metadata(
&self,
) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
fn archived_metadata( &self, ) -> <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.