pub struct UltradebugUart { /* private fields */ }
Expand description
Represents the Ultradebug UART.
Implementations§
Source§impl UltradebugUart
impl UltradebugUart
pub fn open(ultradebug: &Ultradebug) -> Result<Self>
Trait Implementations§
Source§impl Uart for UltradebugUart
impl Uart for UltradebugUart
Source§fn get_baudrate(&self) -> Result<u32>
fn get_baudrate(&self) -> Result<u32>
Returns the UART baudrate. May return zero for virtual UARTs.
Source§fn set_baudrate(&self, baudrate: u32) -> Result<()>
fn set_baudrate(&self, baudrate: u32) -> Result<()>
Sets the UART baudrate. May do nothing for virtual UARTs.
Source§fn read_timeout(&self, buf: &mut [u8], timeout: Duration) -> Result<usize>
fn read_timeout(&self, buf: &mut [u8], timeout: Duration) -> Result<usize>
Reads UART receive data into
buf
, returning the number of bytes read.
The timeout
may be used to specify a duration to wait for data.
If timeout expires without any data arriving Ok(0)
will be returned, never Err(_)
.Source§fn read(&self, buf: &mut [u8]) -> Result<usize>
fn read(&self, buf: &mut [u8]) -> Result<usize>
Reads UART receive data into
buf
, returning the number of bytes read.
This function may block.Source§fn set_flow_control(&self, flow_control: bool) -> Result<()>
fn set_flow_control(&self, flow_control: bool) -> Result<()>
Enables software flow control for
write
s.Source§fn get_device_path(&self) -> Result<String>
fn get_device_path(&self) -> Result<String>
Returns
"/dev/ttyUSBn"
or similar OS device path usable by external programs for
directly accessing the serial port.Source§fn clear_rx_buffer(&self) -> Result<()>
fn clear_rx_buffer(&self) -> Result<()>
Clears the UART RX buffer.
fn set_break(&self, _enable: bool) -> Result<()>
fn set_parity(&self, _parity: Parity) -> Result<()>
Source§fn supports_nonblocking_read(&self) -> Result<bool>
fn supports_nonblocking_read(&self) -> Result<bool>
Query if nonblocking mio mode is supported.
Source§fn register_nonblocking_read(
&self,
_registry: &Registry,
_token: Token,
) -> Result<()>
fn register_nonblocking_read( &self, _registry: &Registry, _token: Token, ) -> Result<()>
Switch this
Uart
instance into nonblocking mio mode. Going forward, read()
should
only be called after mio::poll()
has indicated that the given Token
is ready.Source§fn nonblocking_help(&self) -> Result<Rc<dyn NonblockingHelp>>
fn nonblocking_help(&self) -> Result<Rc<dyn NonblockingHelp>>
Get the same single
NonblockingHelp
object as from top level Transport.nonblocking_help()
.Auto Trait Implementations§
impl !Freeze for UltradebugUart
impl !RefUnwindSafe for UltradebugUart
impl !Send for UltradebugUart
impl !Sync for UltradebugUart
impl Unpin for UltradebugUart
impl UnwindSafe for UltradebugUart
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more