1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! # stackaddr
//!
//! `stackaddr` is a library for self-describing, layered address representation.
//! It enables structured, extensible expression of network addresses and associated metadata,
//! supporting both traditional transport protocols and identity-aware addressing.
//!
//! ## Features
//! - Multi-layered address structure (L2-L7)
//! - Protocol segments: `/ip4/127.0.0.1/tcp/443/tls/http`
//! - Also, supports L2 MAC addresses like `/mac/aa:bb:cc:dd:ee:ff`.
//! - Identity segments: `/node/<base32>`, `/uuid/<uuid>`
//! - Metadata and path support
//! - `Display` and `FromStr` support
//! - Optional Serde serialization (`serde` feature)
//!
//! ## Example
//! ```rust
//! use stackaddr::{StackAddr, Protocol, Identity, Segment};
//! use bytes::Bytes;
//!
//! let addr = StackAddr::from_parts(&[
//! Segment::Protocol(Protocol::Ip4("192.168.10.10".parse().unwrap())),
//! Segment::Protocol(Protocol::Udp(4433)),
//! Segment::Protocol(Protocol::Quic),
//! Segment::Identity(Identity::NodeId(Bytes::from_static(&[1; 32]))),
//! ]);
//!
//! println!("{}", addr); // /ip4/192.168.10.10/udp/4433/quic/node/...
//! ```
/// Stack address and protocol representation.
/// Segment definitions, including protocol, identity, metadata, and path.
/// Error types used in [`StackAddr`] and related parsing operations.
pub use StackAddr;
pub use StackAddrError;
pub use Segment;
pub use Identity;
pub use Protocol;
pub use MacAddr;