myelin 0.1.0

Define async service APIs as traits, communicate over channels. Transport and serialization are pluggable.
Documentation
//! Layered stream transport: Framing × Encoding × ReplyRouting.
//!
//! This module decomposes the monolithic postcard-over-stream transport
//! into three composable layers:
//!
//! - **Framing** ([`framing`]) — how bytes are chunked on the wire.
//! - **Encoding** ([`codec`]) — how types become bytes.
//! - **Reply routing** ([`routing`]) — how responses are matched to callers.
//!
//! The layers are composed into a single [`StreamTransport`] that implements
//! [`ClientTransport`](crate::transport::ClientTransport) and
//! [`ServerTransport`](crate::transport::ServerTransport).
//!
//! ## Routing strategies
//!
//! - [`Sequential`] — one request at a time, zero overhead.
//! - [`MuxedSlots`] — up to N concurrent requests via slot-based routing
//!   (1-byte slot ID per frame).

pub mod codec;
pub mod duplex;
pub mod framing;
pub mod mux;
pub mod routing;
pub mod transport;

#[cfg(feature = "cbor")]
pub use codec::CborCodec;
#[cfg(feature = "cbor")]
pub use codec::CborCodecError;
#[cfg(feature = "postcard")]
pub use codec::PostcardCodec;
pub use codec::{Decoder, Encoder};
pub use duplex::{
    DUPLEX_HEADER_LEN, DuplexClientHalf, DuplexFrameError, DuplexHandle, DuplexHeader, DuplexPump,
    DuplexPumpError, DuplexServerError, DuplexServerHalf, DuplexStreamTransport, KIND_REQUEST,
    KIND_RESPONSE, encode_duplex_frame, parse_duplex_frame,
};
pub use framing::{FrameReader, FrameWriter, FramingError, LengthPrefixed};
pub use mux::{ApiHandler, ApiRouter, MuxError, ServiceApiId};
pub use routing::{
    MuxedReplyToken, MuxedSlotGuard, MuxedSlots, MuxedSlots4, MuxedSlots8, ReplyRouter,
    RouterSlotHandle, Sequential,
};
pub use transport::{RouterStorage, StreamReplyToken, StreamTransport, StreamTransportError};