Reduce memory overhead and simplify logic for merging endpoint and control request output reports.
This commit is contained in:
committed by
Dario Nieuwenhuis
parent
c309531874
commit
c8ad82057d
@ -120,6 +120,9 @@ pub trait Endpoint {
|
||||
|
||||
pub trait EndpointOut: Endpoint {
|
||||
type ReadFuture<'a>: Future<Output = Result<usize, ReadError>> + 'a
|
||||
where
|
||||
Self: 'a;
|
||||
type DataReadyFuture<'a>: Future<Output = ()> + 'a
|
||||
where
|
||||
Self: 'a;
|
||||
|
||||
@ -128,6 +131,11 @@ pub trait EndpointOut: Endpoint {
|
||||
///
|
||||
/// This should also clear any NAK flags and prepare the endpoint to receive the next packet.
|
||||
fn read<'a>(&'a mut self, buf: &'a mut [u8]) -> Self::ReadFuture<'a>;
|
||||
|
||||
/// Waits until a packet of data is ready to be read from the endpoint.
|
||||
///
|
||||
/// A call to[`read()`](Self::read()) after this future completes should not block.
|
||||
fn wait_data_ready<'a>(&'a mut self) -> Self::DataReadyFuture<'a>;
|
||||
}
|
||||
|
||||
pub trait ControlPipe {
|
||||
|
Reference in New Issue
Block a user