pub enum ClockDomain {
Sample,
Block,
Control,
MidiTick,
Wall,
Transport,
ServerFrame,
BrowserFrame,
TraceStep,
Job,
}Expand description
Clock a stream is timed against.
Each variant names one timeline a packet can ride; the kernel defines the
clock-domain contract as Symbols, and this enum is the concrete set this
fabric understands. ClockDomain::symbol maps a variant to its kernel
symbol and ClockDomain::from_symbol parses it back, accepting the bare
label, the clock/<label> form, and the fully qualified
stream/clock-domain/<label> form.
§Examples
use sim_lib_stream_core::ClockDomain;
let domain = ClockDomain::Sample;
assert_eq!(domain.wire_label(), "sample");
let parsed = ClockDomain::from_symbol(&domain.symbol()).unwrap();
assert_eq!(parsed, domain);Variants§
Sample
Per-sample audio timeline (the finest audio clock).
Block
Per-block processing timeline (one tick per audio block).
Control
Control-rate timeline for parameter and modulation updates.
MidiTick
MIDI tick timeline (musical clock pulses).
Wall
Wall-clock (real-world) time.
Transport
Transport timeline (musical position: bars/beats under play control).
ServerFrame
Server-side frame timeline.
BrowserFrame
Browser-side frame timeline (client render cadence).
TraceStep
Trace-step timeline for stepped/replayed execution.
Job
Job timeline keyed to background job progress.
Implementations§
Source§impl ClockDomain
impl ClockDomain
Sourcepub fn wire_label(self) -> &'static str
pub fn wire_label(self) -> &'static str
Returns the stable wire label for this domain (for example "sample").
Sourcepub fn symbol(self) -> Symbol
pub fn symbol(self) -> Symbol
Returns the kernel Symbol for this domain, namespaced under
stream/clock-domain.
Sourcepub fn from_symbol(symbol: &Symbol) -> Result<Self>
pub fn from_symbol(symbol: &Symbol) -> Result<Self>
Parses a ClockDomain from a kernel Symbol.
Accepts the bare label, the legacy clock/<label> form, and the fully
qualified stream/clock-domain/<label> form. Returns an error for any
unrecognized clock domain.
Sourcepub fn for_stream_clock(symbol: &Symbol) -> Self
pub fn for_stream_clock(symbol: &Symbol) -> Self
Resolves the clock domain for a stream’s declared clock symbol, falling
back to ClockDomain::ServerFrame when the symbol is unrecognized.
Trait Implementations§
Source§impl Clone for ClockDomain
impl Clone for ClockDomain
Source§fn clone(&self) -> ClockDomain
fn clone(&self) -> ClockDomain
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for ClockDomain
Source§impl Debug for ClockDomain
impl Debug for ClockDomain
impl Eq for ClockDomain
Source§impl PartialEq for ClockDomain
impl PartialEq for ClockDomain
Source§fn eq(&self, other: &ClockDomain) -> bool
fn eq(&self, other: &ClockDomain) -> bool
self and other values to be equal, and is used by ==.