embassy-usb-driver

Crates

git

Versions

default

Flavors

Skip to main content

IsoEndpointIn

Trait IsoEndpointIn 

Source
pub trait IsoEndpointIn: Endpoint {
    type Slot<'a>: IsoInSlot
       where Self: 'a;

    // Required methods
    fn queue_depth(&self) -> u8;
    async fn ready(&mut self) -> Result<Self::Slot<'_>, EndpointDisabledError>;
}
Expand description

Isochronous IN endpoint trait.

Drivers implement this only when they can schedule packets by service interval and drop uncollected packets instead of sending them late.

Required Associated Types§

Source

type Slot<'a>: IsoInSlot
where Self: 'a,

A reserved slot borrowing this endpoint.

Required Methods§

Source

fn queue_depth(&self) -> u8

How many packets may be committed ahead of the one the host collects next.

  • 1: one packet can be committed. ready waits until the previous packet has been sent or dropped before offering another slot.
  • n: ready may offer a slot while n packets are still queued.

This is what the driver actually provides. EndpointConfig::buffers is only a hint.

Source

async fn ready(&mut self) -> Result<Self::Slot<'_>, EndpointDisabledError>

Wait until the next packet can be queued, returning a reserved slot for its service interval.

While the writer keeps up, each call yields the next service interval. The first call, and any call after the writer fell behind, yields the next interval that can still be armed, reporting any gap via IsoInSlot::skipped.

§Cancel safety

Dropping the returned future or dropping the returned slot before calling IsoInSlot::write leaves nothing armed, and the endpoint remains usable for future calls.

§Errors

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§