pub struct FramedConnection<S>where
S: NonBlockingRx + NonBlockingTx,{ /* private fields */ }Expand description
Wrapper around a serial port to provide framed connections.
See the module level documentation for more information.
Implementations§
Source§impl<S> FramedConnection<S>where
S: NonBlockingRx + NonBlockingTx,
impl<S> FramedConnection<S>where
S: NonBlockingRx + NonBlockingTx,
Sourcepub fn new(s: S) -> FramedConnection<S>
pub fn new(s: S) -> FramedConnection<S>
Create a new FramedConnection. Takes ownership of the serial device.
Sourcepub fn schedule_send(&mut self, frame: Vec<u8>) -> Result<(), Error>
pub fn schedule_send(&mut self, frame: Vec<u8>) -> Result<(), Error>
Schedule a frame to be sent. Returns Err(Error) if the frame is too long,
otherwise returns immediately with Ok(()).
Sourcepub fn block_until_send_done(&mut self) -> Result<(), Error>
pub fn block_until_send_done(&mut self) -> Result<(), Error>
Wait until previous send is done.
Sourcepub fn tick(&mut self) -> Result<TickProgress, Error>
pub fn tick(&mut self) -> Result<TickProgress, Error>
Service the connection.
Auto Trait Implementations§
impl<S> Freeze for FramedConnection<S>where
S: Freeze,
impl<S> RefUnwindSafe for FramedConnection<S>where
S: RefUnwindSafe,
impl<S> Send for FramedConnection<S>where
S: Send,
impl<S> Sync for FramedConnection<S>where
S: Sync,
impl<S> Unpin for FramedConnection<S>where
S: Unpin,
impl<S> UnwindSafe for FramedConnection<S>where
S: 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