Skip to main content

LineageContext

Struct LineageContext 

Source
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: String

The resolved root ancestor id (the clip’s own id when it is a root).

§root_title: String

The root ancestor’s title (empty when the root is outside the index).

§parent_id: String

The 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: ResolveStatus

How root resolution terminated.

Implementations§

Source§

impl LineageContext

Source

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.

Source

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).

Source

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

Source§

fn clone(&self) -> LineageContext

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 LineageContext

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for LineageContext

Source§

impl PartialEq for LineageContext

Source§

fn eq(&self, other: &LineageContext) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for LineageContext

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.