pub struct ItemRef {
pub logical_path: String,
pub is_dir: bool,
pub content_hash: Option<String>,
pub size: Option<u64>,
pub media_type: Option<String>,
pub projection_hint: ProjectionHint,
pub tabular_parse: Option<TabularParseConfig>,
pub handle: String,
}Expand description
Metadata-only view of one side of a comparison. Carries logical identity
and content metadata but NOT a filesystem path — data access goes through
DataAccess.
§Metadata invariants
content_hash, size, and media_type are opportunistic hints.
Producers (expand rules like directory/zip, or data backends)
populate them when doing so is cheap — typically as a byproduct of work
they were already performing. Consumers must not assume presence, but
may trust presence: when a field is set, the value accurately reflects
the current bytes. Use ItemRef::resolve_hash / ItemRef::resolve_size
to obtain a value with a transparent fall-back read.
This keeps fast paths (directory-only listings, short-circuit identical detection) cheap while letting consumers that need a value — most notably the move detector, which correlates leaves across container boundaries — hydrate on demand.
Fields§
§logical_path: StringUser-meaningful location within a snapshot. /> marks a
decompose boundary; a literal segment beginning with > is escaped
as \>.
is_dir: bool§content_hash: Option<String>§size: Option<u64>§media_type: Option<String>§projection_hint: ProjectionHintOptional projection metadata supplied by rule packs while they still know the vocabulary. Core carries this through but does not interpret file names, media types, or plugin-specific tags.
tabular_parse: Option<TabularParseConfig>Optional stdlib-resolved tabular parse hints carried from dataset config to whichever tabular parser eventually claims this item.
handle: StringOpaque identifier used by DataAccess implementations to locate data. Plugin authors should not create or interpret this value directly.
Implementations§
Source§impl ItemRef
impl ItemRef
pub fn extension(&self) -> Option<String>
Sourcepub fn resolve_hash(&self, data: &dyn DataAccess) -> BinocResult<String>
pub fn resolve_hash(&self, data: &dyn DataAccess) -> BinocResult<String>
Return the item’s BLAKE3 content hash, computing it from bytes if
not already cached on this ItemRef. Never valid for directories.
Sourcepub fn resolve_size(&self, data: &dyn DataAccess) -> BinocResult<u64>
pub fn resolve_size(&self, data: &dyn DataAccess) -> BinocResult<u64>
Return the item’s byte length, reading from the backend if not already
cached on this ItemRef. Never valid for directories.