pub trait Endpoint {
// Required methods
fn info(&self) -> EndpointInfo;
async fn wait_enabled(&mut self);
fn is_enabled(&self) -> bool;
async fn set_stall(&mut self, stalled: bool) -> Result<(), Unsupported>;
fn is_stalled(&self) -> Result<bool, Unsupported>;
}Expand description
Endpoint trait, common for OUT and IN. Endpoint is a buffer on a device that stores rx/tx data. Endpoint can be thought of as one end of a pipe/channel.
Required Methods§
Sourcefn info(&self) -> EndpointInfo
fn info(&self) -> EndpointInfo
Get the endpoint address and attributes.
Sourceasync fn wait_enabled(&mut self)
async fn wait_enabled(&mut self)
Wait for the endpoint to be enabled.
Resolves once the endpoint has been enabled via Bus::endpoint_set_enabled (and has not
been disabled again, e.g. by a bus reset).
Sourcefn is_enabled(&self) -> bool
fn is_enabled(&self) -> bool
Get whether the endpoint is enabled.
Sourceasync fn set_stall(&mut self, stalled: bool) -> Result<(), Unsupported>
async fn set_stall(&mut self, stalled: bool) -> Result<(), Unsupported>
Set or clear the STALL handshake on this endpoint.
While stalled, bulk and interrupt endpoints answer tokens with STALL. Control and isochronous endpoints ignore this. Clearing the stall resets the data toggle to DATA0, whether or not the endpoint was stalled. Enabling the endpoint clears a stall; stalling before the endpoint is enabled may not take effect.
§Errors
Unsupported- This driver cannot halt endpoints.
Sourcefn is_stalled(&self) -> Result<bool, Unsupported>
fn is_stalled(&self) -> Result<bool, Unsupported>
Get whether the STALL handshake is set on this endpoint.
Returns Ok(false) for endpoints that do not have the halt feature.
§Errors
Unsupported- This driver cannot halt endpoints.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".