pub struct SerialWrap<T>where
T: SerialPort,{ /* private fields */ }Expand description
Implment the traits required for a FramedConnection based
on a serial::SerialPort.
Note that the async processing of FramedConnection depends on
a short timeout being set. At the time of writing, serial::open() returned
a SerialPort with a default of 100 msec.
Implementations§
Source§impl<T> SerialWrap<T>where
T: SerialPort,
impl<T> SerialWrap<T>where
T: SerialPort,
Sourcepub fn new(port: T) -> SerialWrap<T>
pub fn new(port: T) -> SerialWrap<T>
Constructor
Trait Implementations§
Source§impl<T> MutNonBlockingRx for SerialWrap<T>where
T: SerialPort,
impl<T> MutNonBlockingRx for SerialWrap<T>where
T: SerialPort,
Source§impl<T> MutNonBlockingTx for SerialWrap<T>where
T: SerialPort,
impl<T> MutNonBlockingTx for SerialWrap<T>where
T: SerialPort,
Source§fn putc_try(&mut self, ch: u8) -> Result<Option<u8>, Self::Error>
fn putc_try(&mut self, ch: u8) -> Result<Option<u8>, Self::Error>
Try and write a single octet to the port’s transmitter.
Will return Ok(None) if the FIFO/buffer was full
and the octet couldn’t be stored or Ok(Some(ch))
if it was stored OK.
In some implementations, this can result in an Error.
If not, use type Error = !.
Auto Trait Implementations§
impl<T> Freeze for SerialWrap<T>where
T: Freeze,
impl<T> RefUnwindSafe for SerialWrap<T>where
T: RefUnwindSafe,
impl<T> Send for SerialWrap<T>where
T: Send,
impl<T> Sync for SerialWrap<T>where
T: Sync,
impl<T> Unpin for SerialWrap<T>where
T: Unpin,
impl<T> UnwindSafe for SerialWrap<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