Skip to main content

Driver

Trait Driver 

Source
pub trait Driver: Send {
Show 15 methods // Required methods fn open(&mut self, transport: &SharedTransport) -> Result<()>; fn close(&mut self) -> Result<()>; fn write(&mut self, data: &[u8]) -> Result<usize>; fn read(&mut self, buf: &mut [u8]) -> Result<usize>; fn set_line_config(&mut self, cfg: LineConfig) -> Result<()>; fn set_flow_control(&mut self, flow: FlowControl) -> Result<()>; fn set_dtr(&mut self, value: bool) -> Result<()>; fn set_rts(&mut self, value: bool) -> Result<()>; fn set_break(&mut self, enabled: bool) -> Result<()>; fn purge(&mut self, kind: PurgeKind) -> Result<()>; fn modem_status(&mut self) -> Result<ModemStatus>; fn bulk_in_mps(&self) -> u16; fn take_bulk_in(&mut self) -> Option<Box<dyn BulkIn>>; // Provided methods fn rx_filters(&self) -> Vec<Box<dyn RxFilter>> { ... } fn start_reader(&mut self) -> Result<SerialReader> { ... }
}
Expand description

Chip-specific USB serial protocol (control transfers + bulk endpoints).

Required Methods§

Source

fn open(&mut self, transport: &SharedTransport) -> Result<()>

Source

fn close(&mut self) -> Result<()>

Source

fn write(&mut self, data: &[u8]) -> Result<usize>

Source

fn read(&mut self, buf: &mut [u8]) -> Result<usize>

Source

fn set_line_config(&mut self, cfg: LineConfig) -> Result<()>

Source

fn set_flow_control(&mut self, flow: FlowControl) -> Result<()>

Source

fn set_dtr(&mut self, value: bool) -> Result<()>

Source

fn set_rts(&mut self, value: bool) -> Result<()>

Source

fn set_break(&mut self, enabled: bool) -> Result<()>

Source

fn purge(&mut self, kind: PurgeKind) -> Result<()>

Source

fn modem_status(&mut self) -> Result<ModemStatus>

Source

fn bulk_in_mps(&self) -> u16

Source

fn take_bulk_in(&mut self) -> Option<Box<dyn BulkIn>>

Provided Methods§

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§