pub struct LineageContext {
pub root_id: String,
pub root_title: String,
pub parent_id: String,
pub edge_type: Option<EdgeType>,
pub status: ResolveStatus,
}Expand description
The resolved lineage of a single clip, threaded into naming, tagging, and change detection.
This is 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 that get embedded in a path or a tag (the root the clip folders
under, the immediate parent and how it derives from it), so those consumers
never re-read the now-defunct root_ancestor_id/album_title 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).
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.
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.
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).
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.
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 ==.