Skip to main content

AliasMap

Struct AliasMap 

Source
pub struct AliasMap {
    pub entries: BTreeMap<String, AliasEntry>,
    pub identifiers: usize,
    pub canonical_zones: usize,
    pub links: usize,
    pub duplicated_byte_links: usize,
}
Expand description

The whole manifest: a deterministic (sorted) map of identifiers plus summary counts.

Fields§

§entries: BTreeMap<String, AliasEntry>

Identifier → entry, ordered by name for deterministic output.

§identifiers: usize§canonical_zones: usize§links: usize§duplicated_byte_links: usize

Links materialised as byte copies (i.e. where the same TZif bytes exist under two names). This is the figure jiff#258 was asking to make visible.

Implementations§

Source§

impl AliasMap

Source

pub fn validate(&self) -> Result<()>

Validate the alias map’s internal consistency (T12.4c). Guarantees that every Link entry “corresponds to a materialised link/copy” of a real compiled zone:

  • every Link’s target is present in this map as a Zone entry (no dangling alias — “missing target fails”; a link that resolved to another link, or to nothing, never gets here because build records the resolved canonical zone);
  • the Link’s recorded target_sha256 is non-empty and equals that zone’s hash (the alias genuinely names those exact bytes — the jiff#258 duplication is real, not asserted);
  • no entry is a self-link (name == target) — resolve_link_target already rejects self-links/cycles upstream (they are skipped in plan::run and counted failed in the link profile), so this is the alias-map-level guard that keeps that coverage honest;
  • the summary counts (canonical_zones/links/identifiers) agree with the entries.

build calls this before returning, so any AliasMap handed out is already consistent.

Source

pub fn to_json(&self) -> String

Render the manifest as deterministic, pretty-printed JSON (2-space indent, keys in a fixed order; entries sorted by identifier via the BTreeMap).

Source

pub fn write_to(&self, path: &Path) -> Result<()>

Write the manifest JSON to path.

Trait Implementations§

Source§

impl Clone for AliasMap

Source§

fn clone(&self) -> AliasMap

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for AliasMap

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.