Struct rust_uart::Connection [−][src]
Wrapper for UART stream
Fields
stream: Box<Stream>
Any boxed stream that allows for communication over serial ports
Methods
impl Connection
[src]
impl Connection
pub fn new(stream: Box<Stream>) -> Connection
[src]
pub fn new(stream: Box<Stream>) -> Connection
Constructor to creation connection with provided stream
pub fn from_path(
bus: &str,
settings: PortSettings,
timeout: Duration
) -> UartResult<Connection>
[src]
pub fn from_path(
bus: &str,
settings: PortSettings,
timeout: Duration
) -> UartResult<Connection>
Convenience constructor to create connection from bus path
pub fn write(&self, data: &[u8]) -> UartResult<()>
[src]
pub fn write(&self, data: &[u8]) -> UartResult<()>
Writes out raw bytes to the stream
pub fn read(&self, len: usize, timeout: Duration) -> UartResult<Vec<u8>>
[src]
pub fn read(&self, len: usize, timeout: Duration) -> UartResult<Vec<u8>>
Reads messages upto specified length recieved on the bus
Auto Trait Implementations
impl Send for Connection
impl Send for Connection
impl !Sync for Connection
impl !Sync for Connection