Struct rust_uart::Connection
source · [−]Expand description
Wrapper for UART stream
Fields
stream: Box<dyn Stream>
Any boxed stream that allows for communication over serial ports
Implementations
sourceimpl Connection
impl Connection
sourcepub fn new(stream: Box<dyn Stream>) -> Connection
pub fn new(stream: Box<dyn Stream>) -> Connection
Constructor to creation connection with provided stream
sourcepub fn from_path(
bus: &str,
settings: PortSettings,
timeout: Duration
) -> UartResult<Connection>
pub fn from_path(
bus: &str,
settings: PortSettings,
timeout: Duration
) -> UartResult<Connection>
Convenience constructor to create connection from bus path
sourcepub fn write(&self, data: &[u8]) -> UartResult<()>
pub fn write(&self, data: &[u8]) -> UartResult<()>
Writes out raw bytes to the stream
Auto Trait Implementations
impl !RefUnwindSafe for Connection
impl Send for Connection
impl !Sync for Connection
impl Unpin for Connection
impl !UnwindSafe for Connection
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more