[−][src]Crate tokio_socketcan
tokio-socketcan
Connective plumbing between the socketcan crate and the tokio asynchronous I/O system
Usage
The socketcan crate's documentation is valuable as the api used by tokio-socketcan is largely identical to the socketcan one.
An example echo server:
use futures::stream::Stream; use futures::future::{self, Future}; let socket_rx = tokio_socketcan::CANSocket::open("vcan0").unwrap(); let socket_tx = tokio_socketcan::CANSocket::open("vcan0").unwrap(); tokio::run(socket_rx.for_each(move |frame| { socket_tx.write_frame(frame) }).map_err(|_err| {}));
Structs
CANFrame | CANFrame |
CANSocket | An asynchronous I/O wrapped socketcan::CANSocket |
CANWriteFuture | A Future representing the eventual writing of a CANFrame to the socket |
EventedCANSocket | A socketcan::CANSocket wrapped for mio eventing to allow it be integrated in turn into tokio |
Enums
CANSocketOpenError | Errors opening socket |