pub trait EndpointOut: Endpoint {
// Required method
async fn read_transfer(
&mut self,
buf: &mut [u8],
) -> Result<usize, EndpointError>;
}Expand description
OUT Endpoint trait.
Required Methods§
Sourceasync fn read_transfer(
&mut self,
buf: &mut [u8],
) -> Result<usize, EndpointError>
async fn read_transfer( &mut self, buf: &mut [u8], ) -> Result<usize, EndpointError>
Read until the buffer is full or we receive a short packet from the USB host returning the actual length of the entire data block.
This should also clear any NAK flags and prepare the endpoint to receive the next packet or data block.
§Errors
EndpointError::Disabled- The endpoint is disabled.EndpointError::BufferOverflow- A received packet is larger than the remaining space inbuf(for example ifbuf.len()is smaller thanmax_packet_sizeor not a multiple ofmax_packet_size).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".