Skip to main content

embedded_can_socketcan/
lib.rs

1#![warn(missing_docs)]
2
3//! Linux SocketCAN adapters implementing `embedded-can-interface` traits.
4//!
5//! On Linux, this crate wraps the [`socketcan`] crate's sockets in small newtypes that implement
6//! the `embedded-can-interface` I/O traits (`TxFrameIo`, `RxFrameIo`, etc).
7//!
8//! On non-Linux targets, the types are present but constructors return
9//! [`UnsupportedPlatformError`].
10
11#[cfg(target_os = "linux")]
12mod linux;
13
14#[cfg(target_os = "linux")]
15pub use linux::*;
16
17#[cfg(not(target_os = "linux"))]
18mod non_linux;
19
20#[cfg(not(target_os = "linux"))]
21pub use non_linux::*;