embassy-usb-driver

Crates

git

Versions

default

Flavors

Skip to main content

EndpointIn

Trait EndpointIn 

Source
pub trait EndpointIn: Endpoint {
    // Required method
    async fn write_transfer(
        &mut self,
        buf: &[u8],
        needs_zlp: bool,
    ) -> Result<(), EndpointDisabledError>;
}
Expand description

IN Endpoint trait.

Required Methods§

Source

async fn write_transfer( &mut self, buf: &[u8], needs_zlp: bool, ) -> Result<(), EndpointDisabledError>

Write all the data from buf to the endpoint as a transfer.

The driver is responsible for splitting large transfers into packets, sending them, and optionally sending a zero-length packet (ZLP) if needs_zlp is true and buf.len() is an exact non-zero multiple of max_packet_size. If buf is empty, a single zero-length packet is sent.

Drivers are allowed to buffer packets/transfers and return before the host acknowledges them.

For isochronous endpoints, use IsoEndpointIn instead of this.

§Errors

Dyn Compatibility§

This trait is not dyn compatible.

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

Implementors§