embassy-usb

Crates

git

Versions

default

Flavors

Skip to main content

LineInStream

Struct LineInStream 

Source
pub struct LineInStream<'d, D: Driver<'d>> { /* private fields */ }
Expand description

Line in stream (device to host, isochronous IN endpoint).

Implementations§

Source§

impl<'d, D: Driver<'d>> LineInStream<'d, D>

Source

pub async fn ready( &mut self, ) -> Result<<D::EndpointIn as IsoEndpointIn>::Slot<'_>, EndpointDisabledError>

Wait until the next audio packet can be queued, returning a reserved slot.

IsoInSlot::skipped reports how many intervals this writer left empty, so a late task can advance its stream instead of building a packet per missed interval.

Source

pub async fn write_packet( &mut self, data: &[u8], ) -> Result<Option<NonZeroU32>, IsoWriteError>

Writes one audio packet for the next service interval.

Returns how many intervals were skipped before this packet, if any. When the samples depend on timing or skipped intervals, call ready first, build them, and submit with IsoInSlot::write. A packet the host does not poll for is dropped rather than sent late.

Source

pub async fn wait_connection(&mut self)

Waits for the host to select the streaming alternate setting.

Source

pub fn endpoint_index(&self) -> usize

The isochronous IN endpoint’s index.

Auto Trait Implementations§

§

impl<'d, D> Forget for LineInStream<'d, D>

§

impl<'d, D> Freeze for LineInStream<'d, D>
where <D as Driver<'d>>::EndpointIn: Freeze,

§

impl<'d, D> Move for LineInStream<'d, D>

§

impl<'d, D> RefUnwindSafe for LineInStream<'d, D>
where <D as Driver<'d>>::EndpointIn: RefUnwindSafe,

§

impl<'d, D> Send for LineInStream<'d, D>
where <D as Driver<'d>>::EndpointIn: Send,

§

impl<'d, D> Sync for LineInStream<'d, D>
where <D as Driver<'d>>::EndpointIn: Sync,

§

impl<'d, D> Unpin for LineInStream<'d, D>
where <D as Driver<'d>>::EndpointIn: Unpin,

§

impl<'d, D> UnsafeUnpin for LineInStream<'d, D>
where <D as Driver<'d>>::EndpointIn: UnsafeUnpin,

§

impl<'d, D> UnwindSafe for LineInStream<'d, D>
where <D as Driver<'d>>::EndpointIn: UnwindSafe,

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.