AUDIO
Source snapshot · 12 October 2026

API reference / ravet_device::RecoveringClockedDuplex

Struct RecoveringClockedDuplex 

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>

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)

Disable releases both streams now; reenable opens fresh at next service.

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)>

Current independent atomic input/output/clock counters; reset on reopen.

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.

Auto Trait Implementations§

§

impl<P, F> !RefUnwindSafe for RecoveringClockedDuplex<P, F>

§

impl<P, F> !UnwindSafe for RecoveringClockedDuplex<P, F>

§

impl<P, F> Freeze for RecoveringClockedDuplex<P, F>
where F: Freeze,

§

impl<P, F> Send for RecoveringClockedDuplex<P, F>
where F: Send,

§

impl<P, F> Sync for RecoveringClockedDuplex<P, F>
where F: Sync,

§

impl<P, F> Unpin for RecoveringClockedDuplex<P, F>
where F: Unpin,

§

impl<P, F> UnsafeUnpin for RecoveringClockedDuplex<P, F>
where F: UnsafeUnpin,

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AutoreleaseSafe for T
where T: ?Sized,

§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<S, T> Duplex<S> for Twhere T: FromSample<S> + ToSample<S>,

§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<S> FromSample<S> for S

§

fn from_sample_(s: S) -> S

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<F, T> IntoSample<T> for Fwhere T: FromSample<F>,

§

fn into_sample(self) -> T

§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T, U> ToSample<U> for Twhere U: FromSample<T>,

§

fn to_sample_(self) -> U

§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.