ndn_faces/
lib.rs

1//! # ndn-faces — NDN face implementations
2//!
3//! All face transports for ndn-rs in a single crate, organised as submodules:
4//!
5//! | Module | Types | Feature |
6//! |--------|-------|---------|
7//! | [`net`] | [`UdpFace`], [`TcpFace`], [`MulticastUdpFace`], [`WebSocketFace`] | `net` / `websocket` |
8//! | [`local`] | [`InProcFace`], [`InProcHandle`], [`ShmFace`], [`UnixFace`], [`IpcFace`] | `local` / `spsc-shm` |
9//! | [`serial`] | [`SerialFace`], [`CobsCodec`] | `serial` |
10//! | [`l2`] | [`NamedEtherFace`], [`MulticastEtherFace`], [`BleFace`], [`WfbFace`] | `l2` / `bluetooth` / `wfb` |
11//!
12//! ## Quick re-exports
13//!
14//! The most common types are re-exported at the crate root:
15//!
16//! ```rust,ignore
17//! use ndn_faces::{UdpFace, TcpFace, InProcFace, InProcHandle};
18//! ```
19
20#![allow(missing_docs)]
21
22/// Network interface enumeration and whitelist/blacklist filtering.
23///
24/// Used by the face system auto-configuration (`[face_system]` in TOML) to
25/// enumerate interfaces and apply whitelist/blacklist patterns.
26pub mod iface;
27
28/// Dynamic interface add/remove watcher (Linux netlink; stubs on other platforms).
29pub mod iface_watcher;
30
31#[cfg(feature = "net")]
32pub mod net;
33
34#[cfg(feature = "local")]
35pub mod local;
36
37#[cfg(feature = "serial")]
38pub mod serial;
39
40#[cfg(feature = "l2")]
41pub mod l2;
42
43// ── Crate-root re-exports ────────────────────────────────────────────────────
44
45#[cfg(feature = "net")]
46pub use ndn_packet::fragment::DEFAULT_UDP_MTU;
47#[cfg(feature = "net")]
48pub use net::{
49    LpReliability, MulticastUdpFace, ReliabilityConfig, RtoStrategy, TcpFace, UdpFace,
50    tcp_face_connect, tcp_face_from_stream,
51};
52
53#[cfg(feature = "websocket")]
54pub use net::WebSocketFace;
55
56#[cfg(feature = "local")]
57pub use local::{InProcFace, InProcHandle, IpcFace, IpcListener, ipc_face_connect};
58
59#[cfg(all(unix, feature = "local"))]
60pub use local::{
61    UnixFace, unix_face_connect, unix_face_from_stream, unix_management_face_from_stream,
62};
63
64#[cfg(all(
65    unix,
66    not(any(target_os = "android", target_os = "ios")),
67    feature = "spsc-shm"
68))]
69pub use local::{ShmError, ShmFace, ShmHandle};
70
71#[cfg(feature = "serial")]
72pub use serial::SerialFace;
73#[cfg(feature = "serial")]
74pub use serial::cobs::CobsCodec;
75#[cfg(all(feature = "serial", feature = "serial"))]
76pub use serial::serial_face_open;
77
78#[cfg(feature = "l2")]
79pub use l2::NDN_ETHERTYPE;
80#[cfg(feature = "l2")]
81pub use l2::{RadioFaceMetadata, RadioTable};
82
83#[cfg(all(feature = "l2", target_os = "linux"))]
84pub use l2::{
85    MacAddr, MulticastEtherFace, NamedEtherFace, NeighborDiscovery, WfbFace, get_interface_mac,
86};
87
88#[cfg(all(feature = "bluetooth", target_os = "linux"))]
89pub use l2::BleFace;
90#[cfg(all(feature = "l2", target_os = "macos"))]
91pub use l2::{MulticastEtherFace, NamedEtherFace};
92#[cfg(all(feature = "l2", target_os = "windows"))]
93pub use l2::{MulticastEtherFace, NamedEtherFace};