pub struct OpSequence { /* private fields */ }Expand description
Maps cycle numbers to op templates using a pre-computed LUT.
The LUT length equals the sum of all ratios (the “stanza length”).
cycle % stanza_length indexes into the LUT to select an op.
Implementations§
Source§impl OpSequence
impl OpSequence
Sourcepub fn build(
ops: Vec<ParsedOp>,
ratios: &[u64],
strategy: SequencerType,
) -> Self
pub fn build( ops: Vec<ParsedOp>, ratios: &[u64], strategy: SequencerType, ) -> Self
Build a sequence from ops with explicit ratios and strategy.
Sourcepub fn uniform(ops: Vec<ParsedOp>) -> Self
pub fn uniform(ops: Vec<ParsedOp>) -> Self
Build with uniform ratios (1 each) using bucket sequencing.
Sourcepub fn from_ops(ops: Vec<ParsedOp>, strategy: SequencerType) -> Self
pub fn from_ops(ops: Vec<ParsedOp>, strategy: SequencerType) -> Self
Build from ops, extracting ratios from the ratio param
on each op template (defaults to 1).
Build from ops, extracting ratios from the ratio field.
Checks params["ratio"] first (explicit params), then
op["ratio"] (inline with op fields). Defaults to 1.
Sourcepub fn get_with_index(&self, cycle: u64) -> (usize, &ParsedOp)
pub fn get_with_index(&self, cycle: u64) -> (usize, &ParsedOp)
Get the op template and its index for a given cycle.
Sourcepub fn stanza_length(&self) -> usize
pub fn stanza_length(&self) -> usize
Stanza length (sum of all ratios = LUT length).
Sourcepub fn stanza_ops(&self, base_cycle: u64) -> Vec<(&ParsedOp, u64)>
pub fn stanza_ops(&self, base_cycle: u64) -> Vec<(&ParsedOp, u64)>
Get all ops in a stanza starting at the given cycle.
Returns (op_template, cycle_within_stanza) pairs for each position in the stanza. Used by the capture-aware executor to process a full stanza as a unit.
Sourcepub fn sequencer_type(&self) -> SequencerType
pub fn sequencer_type(&self) -> SequencerType
The sequencing strategy used.
Auto Trait Implementations§
impl Forget for OpSequence
impl Freeze for OpSequence
impl Move for OpSequence
impl RefUnwindSafe for OpSequence
impl Send for OpSequencewhere
RawVecInner: Send,
RawTable<(String, Value)>: Send,
RawTable<(String, String)>: Send,
RawTable<(String, MetricSpec)>: Send,
NodeRef<Owned, String, String, LeafOrInternal>: Send,
BoxRaw<(String, String)>: Send,
NodeRef<Owned, String, PortType, LeafOrInternal>: Send,
BoxRaw<(String, PortType)>: Send,
impl Sync for OpSequencewhere
RawVecInner: Sync,
RawTable<(String, Value)>: Sync,
RawTable<(String, String)>: Sync,
RawTable<(String, MetricSpec)>: Sync,
NodeRef<Owned, String, String, LeafOrInternal>: Sync,
BoxRaw<(String, String)>: Sync,
NodeRef<Owned, String, PortType, LeafOrInternal>: Sync,
BoxRaw<(String, PortType)>: Sync,
impl Unpin for OpSequence
impl UnsafeUnpin for OpSequencewhere
*const u8 is !null: UnsafeUnpin,
PhantomData<ParsedOp>: UnsafeUnpin,
PhantomData<usize>: UnsafeUnpin,
impl UnwindSafe for OpSequencewhere
RawVecInner: UnwindSafe,
HashMap<String, Value>: UnwindSafe,
HashMap<String, String>: UnwindSafe,
HashMap<String, MetricSpec>: UnwindSafe,
BTreeMap<String, String>: UnwindSafe,
BTreeMap<String, PortType>: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more