Skip to main content

DomainBridgeDescriptor

Struct DomainBridgeDescriptor 

Source
pub struct DomainBridgeDescriptor { /* private fields */ }
Expand description

Full description of one domain bridge: its kind, the input and output rate contracts it joins, the latency it costs, and its diagnostic symbols.

The constructor helpers (resampler, jitter_buffer, latency_comp_delay, event_rate_gate) build the canonical descriptor for each DomainBridgeKind with its standard rates and latency.

Implementations§

Source§

impl DomainBridgeDescriptor

Source

pub fn new( kind: DomainBridgeKind, input_rate: RateContract, output_rate: RateContract, latency: BridgeLatency, diagnostics: Vec<Symbol>, ) -> Self

Builds a descriptor from explicit kind, input/output rates, latency, and diagnostics.

Source

pub fn resampler(input_hz: u32, output_hz: u32) -> Result<Self>

Builds a resampler bridge between two exact sample rates.

Returns an error if either rate is zero.

Source

pub fn jitter_buffer(max_late_packets: u32) -> Self

Builds a jitter-buffer bridge that tolerates up to max_late_packets late packets of wall-clock buffered-preview input.

Source

pub fn latency_comp_delay(frames: u64) -> Self

Builds a latency-compensation bridge that delays a block-local stream by a fixed number of frames.

Source

pub fn event_rate_gate(input_domain: ClockDomain) -> Result<Self>

Builds an event-rate-gate bridge that gates a control or MIDI-tick input domain into a block-local output.

Returns an error if input_domain is neither ClockDomain::Control nor ClockDomain::MidiTick.

Source

pub fn kind(&self) -> DomainBridgeKind

Returns the bridge kind.

Source

pub fn name(&self) -> &'static str

Returns the bridge kind’s wire label.

Source

pub fn input_rate(&self) -> RateContract

Returns the rate contract this bridge accepts on its input.

Source

pub fn output_rate(&self) -> RateContract

Returns the rate contract this bridge emits on its output.

Source

pub fn latency(&self) -> BridgeLatency

Returns the latency this bridge incurs.

Source

pub fn diagnostics(&self) -> &[Symbol]

Returns the diagnostic symbols this bridge may raise.

Source

pub fn input_edge(&self, media: StreamMedia) -> StreamEdge

Builds the input StreamEdge this bridge presents as a sink for the given media.

Source

pub fn output_edge(&self, media: StreamMedia) -> StreamEdge

Builds the output StreamEdge this bridge presents as a source for the given media.

Trait Implementations§

Source§

impl Clone for DomainBridgeDescriptor

Source§

fn clone(&self) -> DomainBridgeDescriptor

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 DomainBridgeDescriptor

Source§

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

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

impl Eq for DomainBridgeDescriptor

Source§

impl PartialEq for DomainBridgeDescriptor

Source§

fn eq(&self, other: &DomainBridgeDescriptor) -> 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 DomainBridgeDescriptor

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.