pub struct ActiveIndex { /* private fields */ }Expand description
A precomputed interval index for a validated project snapshot.
Implementations§
Source§impl ActiveIndex
impl ActiveIndex
Sourcepub fn build(project: &Project) -> Result<Self, EvalError>
pub fn build(project: &Project) -> Result<Self, EvalError>
Builds an immutable interval tree from a structurally valid project.
§Errors
Returns EvalError::InvalidProject when the model is invalid.
Sourcepub fn project_id(&self) -> &ProjectId
pub fn project_id(&self) -> &ProjectId
Returns the project identity used to build this index.
Sourcepub fn effects(&self) -> impl Iterator<Item = &ClipEffect>
pub fn effects(&self) -> impl Iterator<Item = &ClipEffect>
Every effect invocation the project can draw: the steps of each composition a clip shows or draws as its source (those that compile), and each transition. A compiled composition is shared by every clip that shows it, so its steps come once however many clips show it, in index order of its first use: the walk is linear in the clips and the distinct compositions, never in their product.
Sourcepub fn peak_source_reads(
&self,
range: TimeRange,
counted: impl FnMut(&SourceId) -> bool,
) -> usize
pub fn peak_source_reads( &self, range: TimeRange, counted: impl FnMut(&SourceId) -> bool, ) -> usize
The most sequential reads of host-supplied sources that counted
selects at any one instant of range, or zero when none is read
there. A clip reads its own source while it draws it
(crate::ActiveClip::needs_source), and the source of each media
step of its compositions; crate::frame_needs asks for each of these
frames through its own decoder cursor, so this says how many cursors
decode at once.
Each compiled composition’s reads are counted once however many clips show it, so this is linear in the clips and the distinct compositions’ steps, never in their product.