Trait wasefire_board_api::usb::serial::Api
source · pub trait Api: Send {
// Required methods
fn read(output: &mut [u8]) -> Result<usize, Error>;
fn write(input: &[u8]) -> Result<usize, Error>;
fn flush() -> Result<(), Error>;
fn enable(event: &Event) -> Result<(), Error>;
fn disable(event: &Event) -> Result<(), Error>;
}
Available on crate features
internal-api-usb
and api-usb-serial
only.Expand description
USB serial interface.
Required Methods§
sourcefn read(output: &mut [u8]) -> Result<usize, Error>
fn read(output: &mut [u8]) -> Result<usize, Error>
Reads from the USB serial into a buffer.
Returns the number of bytes read. It could be zero if there’s nothing to read.
Object Safety§
This trait is not object safe.