pub struct LineageContext {
pub root_id: String,
pub root_title: String,
pub root_date: String,
pub parent_id: String,
pub edge_type: Option<EdgeType>,
pub status: ResolveStatus,
pub track: u32,
pub track_total: u32,
}Expand description
The resolved lineage of a single clip, threaded into naming, tagging, and change detection.
The bridge between the pure resolver (Resolution) and the parts of the
engine that turn a clip into files: it carries exactly the resolved values
embedded in a path or tag (the folder root, the immediate parent and its
edge), so those consumers never re-read raw feed fields.
Fields§
§root_id: StringThe resolved root ancestor id (the clip’s own id when it is a root).
root_title: StringThe root ancestor’s title (empty when the root is outside the index).
Built via the lineage store (context_for/album_for_id), this
carries the effective album title, so a manual override supplants the
derived title here and the path, ALBUM tag, and change hash all reflect
it from one source. Store-less contexts (own_root) carry the raw
title.
root_date: StringThe root ancestor’s creation timestamp (its raw created_at), or empty
when the root is outside the index.
Surfaced so the Year tag groups an album under its lineage root’s year: a
later revision crossing a calendar boundary still carries the root’s year.
Store-less contexts (own_root/for_clip) carry the clip’s own
created_at, so year then falls back to the clip’s own year.
parent_id: StringThe immediate parent id (immediate_parent); empty for a root.
edge_type: Option<EdgeType>How the clip derives from its parent; None for a root.
status: ResolveStatusHow root resolution terminated.
track: u32This clip’s 1-based position within its lineage album, or 0 when
unnumbered. Assigned album-wide by
assign_track_numbers; every constructor
here leaves it 0, so a lone or fallback context is never numbered.
track_total: u32The album’s track count paired with track, or 0 when
unnumbered.
Implementations§
Source§impl LineageContext
impl LineageContext
Sourcepub fn for_clip(clip: &Clip, resolution: &Resolution) -> LineageContext
pub fn for_clip(clip: &Clip, resolution: &Resolution) -> LineageContext
Build the context for clip from a whole-library Resolution.
Root id/title/status come from resolution.roots[clip.id]; when the clip
is absent (it was not part of the resolved set) it is treated as its own
resolved root. The parent id and edge come from immediate_parent,
which is empty/None for a root. root_date is the clip’s own
created_at: this store-less path has no window onto the root’s date, so
year falls back to the clip’s own year.
Sourcepub fn own_root(clip: &Clip) -> LineageContext
pub fn own_root(clip: &Clip) -> LineageContext
A self-rooted context for clip: it is treated as its own resolved root
with no parent. Used as a defensive fallback where a resolved context is
unavailable (a clip absent from the current desired set). root_date is
the clip’s own created_at, so it tags its own year.
Sourcepub fn album(&self, own_title: &str) -> String
pub fn album(&self, own_title: &str) -> String
The album the clip folders under: the root ancestor’s title when it is a
real, different root, otherwise own_title.
A root (or an unresolved clip whose root title is empty, or a clip whose root shares its title) folders under its own title; only a resolved, differently-titled ancestor pulls the clip into the ancestor’s album.
Sourcepub fn year(&self, own_created_at: &str) -> String
pub fn year(&self, own_created_at: &str) -> String
The album’s release year: the lineage root’s creation year when known,
otherwise own_created_at’s year.
The root anchors the year so an album whose tracks straddle a calendar
boundary (a December root with a January revision) groups under one year,
mirroring how album anchors the folder on the root’s
title. A root uses its own year; the fallback covers a root whose date is
outside the index.
Trait Implementations§
Source§impl Clone for LineageContext
impl Clone for LineageContext
Source§fn clone(&self) -> LineageContext
fn clone(&self) -> LineageContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LineageContext
impl Debug for LineageContext
impl Eq for LineageContext
Source§impl PartialEq for LineageContext
impl PartialEq for LineageContext
Source§fn eq(&self, other: &LineageContext) -> bool
fn eq(&self, other: &LineageContext) -> bool
self and other values to be equal, and is used by ==.