pub struct Logged<T> { /* private fields */ }Expand description
Middleware that logs the received data.
Implementations§
Trait Implementations§
Source§impl<T: ConsoleDevice> ConsoleMiddleware for Logged<T>
impl<T: ConsoleDevice> ConsoleMiddleware for Logged<T>
fn poll_read_impl( &self, cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<Result<usize>>
fn write_impl(&self, buf: &[u8]) -> Result<()>
fn as_coverage_console_impl(&self) -> Option<&dyn CoverageConsole>
Source§impl<T: ConsoleDevice> Middleware for Logged<T>
impl<T: ConsoleDevice> Middleware for Logged<T>
Source§impl<T: Uart> UartMiddleware for Logged<T>
impl<T: Uart> UartMiddleware for Logged<T>
fn clear_rx_buffer_impl(&self) -> Result<()>
fn get_baudrate_impl(&self) -> Result<u32>
fn set_baudrate_impl(&self, baudrate: u32) -> Result<()>
fn get_flow_control_impl(&self) -> Result<FlowControl>
fn set_flow_control_impl(&self, flow_control: bool) -> Result<()>
fn get_device_path_impl(&self) -> Result<String>
fn set_parity_impl(&self, parity: Parity) -> Result<()>
fn get_parity_impl(&self) -> Result<Parity>
fn set_break_impl(&self, enable: bool) -> Result<()>
fn borrow_fd_impl(&self) -> Result<BorrowedFd<'_>>
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> ConsoleDevice for T
impl<T> ConsoleDevice for T
Source§fn poll_read(
&self,
cx: &mut Context<'_>,
buf: &mut [u8],
) -> Poll<Result<usize, Error>>
fn poll_read( &self, cx: &mut Context<'_>, buf: &mut [u8], ) -> Poll<Result<usize, Error>>
Reads received data into
buf, returning the number of bytes read. Read moreSource§fn as_coverage_console(&self) -> Option<&dyn CoverageConsole>
fn as_coverage_console(&self) -> Option<&dyn CoverageConsole>
Returns a reference to the coverage extraction interface if supported.
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 coverage(self) -> CoverageMiddleware<T>
fn coverage(self) -> CoverageMiddleware<T>
Return a wrapper that extracts coverage data.
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
Source§impl<T> CoverageConsole for T
impl<T> CoverageConsole for T
Source§fn coverage_blocks_processed(&self) -> usize
fn coverage_blocks_processed(&self) -> usize
Returns the number of coverage blocks processed (finished or skipped).
Source§impl<T> Uart for T
impl<T> Uart for T
Source§fn get_baudrate(&self) -> Result<u32, Error>
fn get_baudrate(&self) -> Result<u32, Error>
Returns the UART baudrate. May return zero for virtual UARTs.
Source§fn set_baudrate(&self, baudrate: u32) -> Result<(), Error>
fn set_baudrate(&self, baudrate: u32) -> Result<(), Error>
Sets the UART baudrate. May do nothing for virtual UARTs.
fn get_flow_control(&self) -> Result<FlowControl, Error>
Source§fn set_flow_control(&self, flow_control: bool) -> Result<(), Error>
fn set_flow_control(&self, flow_control: bool) -> Result<(), Error>
Enables software flow control for
writes.Source§fn get_device_path(&self) -> Result<String, Error>
fn get_device_path(&self) -> Result<String, Error>
Returns
"/dev/ttyUSBn" or similar OS device path usable by external programs for
directly accessing the serial port.