embassy-usb-driver

Crates

git

Versions

default

Flavors

Skip to main content

IsoInSlot

Trait IsoInSlot 

Source
pub trait IsoInSlot {
    // Required methods
    fn skipped(&self) -> Option<NonZeroU32>;
    fn write(self, data: &[u8]) -> Result<(), IsoWriteError>;
}
Expand description

A reserved isochronous IN slot, borrowing the endpoint that produced it.

Consuming the slot with write queues one packet for this service interval without waiting. Dropping the slot without calling write leaves this interval empty: nothing is armed, the hardware answers an IN token for it in an implementation-defined way (typically a zero-length packet or no response), and the next IsoEndpointIn::ready call counts this interval in skipped.

Required Methods§

Source

fn skipped(&self) -> Option<NonZeroU32>

Service intervals left empty by the writer before this slot, if any.

None on the first slot and while the writer keeps up. A writer that fell behind gets the whole gap here and is offered the next interval that has not started, instead of building a packet per missed interval.

Packets the host did not poll for are dropped by the driver and are not counted here.

Source

fn write(self, data: &[u8]) -> Result<(), IsoWriteError>

Queue one packet for this slot without waiting.

data is one packet of at most EndpointInfo::max_packet_size bytes, and may be empty. A packet the host does not poll for in its service interval is dropped when the interval ends and is never sent in a later interval.

§Errors

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§