Struct Recovering Clocked Duplex
pub struct RecoveringClockedDuplex<P: Processor + Send + 'static, F: FnMut() -> P> { /* private fields */ }Expand description
Caller-scheduled exact input/output pair recovery with bounded clocked conversion. Service/enable/reopen/drop on a control thread. Missing devices, backend errors or output panic release both streams before fresh FIFO, converters/controller and factory-owned DSP are opened. No fallback, settings changes, polling timer, hotplug subscription, state migration or physical fault/deadline guarantee. Ordinary underflow/overflow or DSP faults do not reopen. Native hosted plug-ins retain their own thread/lifecycle obligations.
Implementations§
§impl<P: Processor + Send + 'static, F: FnMut() -> P> RecoveringClockedDuplex<P, F>
impl<P: Processor + Send + 'static, F: FnMut() -> P> RecoveringClockedDuplex<P, F>
pub fn new(
input_id: impl Into<String>,
output_id: impl Into<String>,
input_config: StreamConfig,
output_config: StreamConfig,
options: ClockedDuplexOptions,
factory: F,
) -> Result<Self, ClockedDuplexRecoveryError>
pub fn new( input_id: impl Into<String>, output_id: impl Into<String>, input_config: StreamConfig, output_config: StreamConfig, options: ClockedDuplexOptions, factory: F, ) -> Result<Self, ClockedDuplexRecoveryError>
Validate fixed configs/clock/converter bounds before enumeration, device work or factory calls. IDs are 1..4096 bytes without NUL. No sinc tables are prepared here; first enabled service opens/starts fresh streams.
pub fn device_ids(&self) -> (&str, &str)
pub fn set_enabled(&mut self, enabled: bool)
pub fn set_enabled(&mut self, enabled: bool)
Disable releases both streams now; reenable opens fresh at next service.
pub fn request_reopen(&mut self)
pub fn request_reopen(&mut self)
Release the pair now; a subsequent enabled service opens fresh state.
pub fn statistics(
&self,
) -> Option<(InputStatistics, OutputStatistics, ClockedDuplexStatistics)>
pub fn statistics( &self, ) -> Option<(InputStatistics, OutputStatistics, ClockedDuplexStatistics)>
Current independent atomic input/output/clock counters; reset on reopen.
pub fn service(
&mut self,
) -> Result<DuplexRecoveryStatus, ClockedDuplexRecoveryError>
pub fn service( &mut self, ) -> Result<DuplexRecoveryStatus, ClockedDuplexRecoveryError>
Enumeration errors retain a current pair. Missing either waits; failed open/start leaves no pair for later retry. Caller owns cadence/backoff; successful pair generations wrap at u64 exhaustion.