Skip to main content

OutputHandle

Struct OutputHandle 

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

Source

pub fn configuration(&self) -> Configuration

Source

pub fn dropped_blocks(&self) -> usize

Counts incoming whole blocks dropped while this sink had insufficient space.

Source

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>

Source

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.

Source

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.

Trait Implementations§

Source§

impl<const S: usize, const B: usize, const F: usize, const O: usize, const Q: usize> Drop for OutputHandle<'_, S, B, F, O, Q>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<'a, const S: usize, const B: usize, const F: usize, const O: usize, const Q: usize> Freeze for OutputHandle<'a, S, B, F, O, Q>

§

impl<'a, const S: usize, const B: usize, const F: usize, const O: usize, const Q: usize> !RefUnwindSafe for OutputHandle<'a, S, B, F, O, Q>

§

impl<'a, const S: usize, const B: usize, const F: usize, const O: usize, const Q: usize> Send for OutputHandle<'a, S, B, F, O, Q>

§

impl<'a, const S: usize, const B: usize, const F: usize, const O: usize, const Q: usize> Sync for OutputHandle<'a, S, B, F, O, Q>

§

impl<'a, const S: usize, const B: usize, const F: usize, const O: usize, const Q: usize> Unpin for OutputHandle<'a, S, B, F, O, Q>

§

impl<'a, const S: usize, const B: usize, const F: usize, const O: usize, const Q: usize> UnsafeUnpin for OutputHandle<'a, S, B, F, O, Q>

§

impl<'a, const S: usize, const B: usize, const F: usize, const O: usize, const Q: usize> !UnwindSafe for OutputHandle<'a, S, B, F, O, Q>

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> 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, 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.