pub trait ConsoleDevice {
// Required methods
fn poll_read(
&self,
cx: &mut Context<'_>,
buf: &mut [u8],
) -> Poll<Result<usize>>;
fn write(&self, buf: &[u8]) -> Result<()>;
// Provided method
fn as_coverage_console(&self) -> Option<&dyn CoverageConsole> { ... }
}Required Methods§
Sourcefn poll_read(&self, cx: &mut Context<'_>, buf: &mut [u8]) -> Poll<Result<usize>>
fn poll_read(&self, cx: &mut Context<'_>, buf: &mut [u8]) -> Poll<Result<usize>>
Reads received data into buf, returning the number of bytes read.
If data is not yet ready, Poll::Pending will be returned and cx would be notified when it’s available.
When this function is called with multiple wakers, all wakers should be notified instead of just the last one.
Provided Methods§
Sourcefn 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.