embassy-usb-driver

Crates

git

Versions

default

Flavors

Trait EndpointIn

Source
pub trait EndpointIn: Endpoint {
    // Required method
    async fn write(&mut self, buf: &[u8]) -> Result<(), EndpointError>;

    // Provided method
    async fn write_transfer(
        &mut self,
        buf: &[u8],
        needs_zlp: bool,
    ) -> Result<(), EndpointError> { ... }
}
Expand description

IN Endpoint trait.

Required Methods§

Source

async fn write(&mut self, buf: &[u8]) -> Result<(), EndpointError>

Write a single packet of data to the endpoint.

Provided Methods§

Source

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

Write all the data from buf to the endpoint one wMaxPacketSize chunk at a time.

If the buffer size is evenly divisible by wMaxPacketSize, this will also ensure the terminating zero-length-packet is transmitted.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§