Trait embedded_serial::BlockingRxWithTimeout
[−]
[src]
pub trait BlockingRxWithTimeout { type Timeout; type Error; fn getc_to(&mut self,
timeout: &Self::Timeout)
-> Result<Option<u8>, Self::Error>; }
Implementors of this trait offer octet based serial data reception using a blocking API with an upper bound on blocking time, and requiring a mutable reference to self.
Associated Types
Required Methods
fn getc_to(&mut self,
timeout: &Self::Timeout)
-> Result<Option<u8>, Self::Error>
timeout: &Self::Timeout)
-> Result<Option<u8>, Self::Error>
Read a single octet from the port's receiver, blocking until the character can be read from the buffer.
In some implementations, this can result in an Error.
If not, use type Error = !
.
If it times out, Ok(None) is returned. If it receives data, Ok(Some(data)) is returned. If it fails, Err(...) is returned.