#numbers #system #autonomous #no-alloc

no-std asn

Newtype for Autonomous System Number (ASN)

2 unstable releases

0.2.0 Oct 28, 2024
0.1.0 Oct 28, 2024

#888 in Parser implementations

Download history 266/week @ 2024-10-28 13/week @ 2024-11-04

279 downloads per month

MIT/Apache

12KB
189 lines

Newtype for Autonomous System Number (ASN)

use asn::Asn;

let asn = Asn::new(0);
assert_eq!(asn, Asn::ZERO);

let asn = Asn::from_str("4294967295").expect("valid const last 32-bit ASN");
assert_eq!(asn, Asn::LAST4);

No runtime deps