pub struct Logged<T> { /* private fields */ }Expand description
Middleware that logs the received data.
Implementations§
Trait Implementations§
Source§impl<T: ConsoleDevice> ConsoleDevice for Logged<T>
impl<T: ConsoleDevice> ConsoleDevice for Logged<T>
Source§impl<T: Uart> Uart for Logged<T>
impl<T: Uart> Uart for Logged<T>
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.
fn get_flow_control(&self) -> Result<FlowControl>
Source§fn set_flow_control(&self, flow_control: bool) -> Result<()>
fn set_flow_control(&self, flow_control: bool) -> Result<()>
Enables software flow control for
writes.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_parity(&self, parity: Parity) -> Result<()>
fn get_parity(&self) -> Result<Parity>
fn set_break(&self, enable: bool) -> Result<()>
Auto Trait Implementations§
impl<T> !Freeze for Logged<T>
impl<T> RefUnwindSafe for Logged<T>where
T: RefUnwindSafe,
impl<T> Send for Logged<T>where
T: Send,
impl<T> Sync for Logged<T>where
T: Sync,
impl<T> Unpin for Logged<T>where
T: Unpin,
impl<T> UnwindSafe for Logged<T>where
T: UnwindSafe,
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
Source§impl<T> ConsoleExt for Twhere
T: ConsoleDevice + ?Sized,
impl<T> ConsoleExt for Twhere
T: ConsoleDevice + ?Sized,
Source§fn read(&self, buf: &mut [u8]) -> Result<usize, Error>
fn read(&self, buf: &mut [u8]) -> Result<usize, Error>
Reads UART receive data into
buf, returning the number of bytes read.
This function is blocking.Source§fn read_timeout(
&self,
buf: &mut [u8],
timeout: Duration,
) -> Result<usize, Error>
fn read_timeout( &self, buf: &mut [u8], timeout: Duration, ) -> Result<usize, Error>
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 try_wait_for_line<P>(
&self,
pattern: P,
timeout: Duration,
) -> Result<Option<<P as MatchPattern>::MatchResult>, Error>where
P: MatchPattern,
fn try_wait_for_line<P>(
&self,
pattern: P,
timeout: Duration,
) -> Result<Option<<P as MatchPattern>::MatchResult>, Error>where
P: MatchPattern,
Wait for a line that matches the specified pattern to appear. Read more
Source§fn wait_for_line<P>(
&self,
pattern: P,
timeout: Duration,
) -> Result<<P as MatchPattern>::MatchResult, Error>where
P: MatchPattern,
fn wait_for_line<P>(
&self,
pattern: P,
timeout: Duration,
) -> Result<<P as MatchPattern>::MatchResult, Error>where
P: MatchPattern,
Wait for a line that matches the specified pattern to appear. Read more