55
66//! # MCTP Stack
77//!
8- //! This crate provides a MCTP stack that can be embedded in other programs
9- //! or devices.
8+ //! This crate provides a MCTP stack and transport bindings,
9+ //! that can be embedded in other programs or devices.
1010//!
11- //! A [`Router`] object lets programs use a [`Stack`] with
12- //! MCTP transport binding links. Each *Port* handles transmitting and receiving
11+ //! The IO-less [`Stack`] handles MCTP message formatting and parsing, independent
12+ //! of any particular MCTP transport binding.
13+ //!
14+ //! A Router for *async* applications is available
15+ //! through the `async` feature.
16+ //! The async `Router` lets programs use a `Stack`
17+ //! by providing implementations for the standard [`mctp` crate](mctp) async traits.
18+ //! Transport bindings are provided by *Ports* which handle transmitting and receiving
1319//! packets independently. Messages destined for the stack's own EID will
1420//! be passed to applications.
1521//!
16- //! Applications can create [`router::RouterAsyncListener`] and [`router::RouterAsyncReqChannel`]
17- //! instances to communicate over MCTP. Those implement the standard [`mctp` crate](mctp)
18- //! async traits.
19- //!
20- //! The IO-less [`Stack`] handles MCTP message formatting and parsing, independent
21- //! of any particular MCTP transport binding.
22+ //! ## Features
23+ //! - `async`: _async_ router implementing [`mctp` crate](mctp) _async_ traits
2224//!
2325//! ## Configuration
2426//!
3537// those reworked when using the log crate either.
3638#![ allow( clippy:: uninlined_format_args) ]
3739#![ warn( clippy:: unused_async) ]
40+ #![ cfg_attr( docsrs, feature( doc_auto_cfg) ) ]
3841
3942#[ cfg( test) ]
4043#[ macro_use]
@@ -61,19 +64,22 @@ pub mod control;
6164pub mod fragment;
6265pub mod i2c;
6366mod reassemble;
67+ #[ cfg( feature = "async" ) ]
6468pub mod router;
6569pub mod serial;
6670pub mod usb;
6771#[ macro_use]
6872mod util;
6973mod proto;
7074
75+ #[ cfg( feature = "async" ) ]
7176#[ rustfmt:: skip]
7277#[ allow( clippy:: needless_lifetimes) ]
7378mod zerocopy_channel;
7479
7580use fragment:: { Fragmenter , SendOutput } ;
7681use reassemble:: Reassembler ;
82+ #[ cfg( feature = "async" ) ]
7783pub use router:: Router ;
7884
7985use crate :: fmt:: * ;
0 commit comments