pub struct OutputHandle<'a, const S: usize, const B: usize, const F: usize, const O: usize, const Q: usize> { /* private fields */ }Expand description
One independently drained output queue. Dropping it releases its output slot.
Implementations§
Source§impl<'a, const S: usize, const B: usize, const F: usize, const O: usize, const Q: usize> OutputHandle<'a, S, B, F, O, Q>
impl<'a, const S: usize, const B: usize, const F: usize, const O: usize, const Q: usize> OutputHandle<'a, S, B, F, O, Q>
pub fn configuration(&self) -> Configuration
Sourcepub fn dropped_blocks(&self) -> usize
pub fn dropped_blocks(&self) -> usize
Counts incoming whole blocks dropped while this sink had insufficient space.
Sourcepub fn with_consumer<R>(
&mut self,
consume: impl for<'c> FnOnce(&mut Consumer<'c, Q>) -> R,
) -> R
pub fn with_consumer<R>( &mut self, consume: impl for<'c> FnOnce(&mut Consumer<'c, Q>) -> R, ) -> R
Borrows the sole consumer without allowing it to escape the reservation. The callback executes without locking the audio core.
Source§impl<const S: usize, const B: usize, const F: usize, const O: usize, const Q: usize> OutputHandle<'static, S, B, F, O, Q>
impl<const S: usize, const B: usize, const F: usize, const O: usize, const Q: usize> OutputHandle<'static, S, B, F, O, Q>
Sourcepub fn into_consumer(self) -> Consumer<'static, Q>
pub fn into_consumer(self) -> Consumer<'static, Q>
Transfers a static system’s consumer to an owning platform adapter. This permanently reserves the output slot: the adapter does not return its consumer, so the system cannot know when it is safe to reuse it.
Sourcepub unsafe fn into_consumer_with_reservation(
self,
) -> (Consumer<'static, Q>, OutputReservation)
pub unsafe fn into_consumer_with_reservation( self, ) -> (Consumer<'static, Q>, OutputReservation)
Transfers the consumer with a token that releases its output slot on drop.
Unlike into_consumer, this permits the system to
reuse the output after the consumer’s owner has been dropped. The adapter
must be destroyed before the returned reservation; a wrapper should own
both and explicitly drop the adapter first.
§Safety
The returned consumer must be dropped before the reservation. Releasing the slot while the consumer is still live would allow the system to split the same ring buffer again while that consumer still references it.