ascii_domain

Domains whose labels are only ASCII.
git clone https://git.philomathiclife.com/repos/ascii_domain
Log | Files | Refs | README

lib.rs (2317B)


      1 //! [![git]](https://git.philomathiclife.com/ascii_domain/log.html) [![crates-io]](https://crates.io/crates/ascii_domain) [![docs-rs]](crate)
      2 //!
      3 //! [git]: https://git.philomathiclife.com/git_badge.svg
      4 //! [crates-io]: https://img.shields.io/badge/crates.io-fc8d62?style=for-the-badge&labelColor=555555&logo=rust
      5 //! [docs-rs]: https://img.shields.io/badge/docs.rs-66c2a5?style=for-the-badge&labelColor=555555&logo=docs.rs
      6 //!
      7 //! `ascii_domain` is a library for efficiently parsing domains based on a supplied ASCII character set one
      8 //! wants to enforce each [`dom::Label`] to conform to. The primary type in the library is [`dom::Domain`]
      9 //! which can be thought of as domains in _representation_ format. Technically since any ASCII `u8` except
     10 //! `b'.'` is allowed in a `Label`, it is more general than an actual representation format that doesn’t
     11 //! include some form of escape characters. For a full-fledged DNS library look elsewhere (e.g.,
     12 //! [`domain`](https://docs.rs/domain/latest/domain/)).
     13 //!
     14 //! The purpose of this library is to allow efficient customization of domain name parsing while still retaining
     15 //! the hierarchical structure of a domain. Depending on one’s use case, allowed formats and characters can
     16 //! differ. If one wants to conform to the [Domain Name System (DNS)](https://www.rfc-editor.org/rfc/rfc2181),
     17 //! all octets are allowed; but conforming to [RFC 1123](https://www.rfc-editor.org/rfc/rfc1123) or
     18 //! [RFC 5891](https://datatracker.ietf.org/doc/html/rfc5891) requires stricter formats and a reduced character
     19 //! set.
     20 #![cfg_attr(docsrs, feature(doc_cfg))]
     21 #![no_std]
     22 /// Contains [`char_set::AllowedAscii`] which is how one dictates the character set [`dom::Domain::try_from_bytes`]
     23 /// uses.
     24 pub mod char_set;
     25 /// Contains [`dom::Domain`] which is a domain whose [`dom::Label`]s consist of a subset of the supplied
     26 /// [`char_set::AllowedAscii`].
     27 ///
     28 /// Also contains [`dom::Rfc1123Domain`] which is a `Domain` that conforms to
     29 /// [RFC 1123](https://www.rfc-editor.org/rfc/rfc1123#page-13).
     30 pub mod dom;
     31 /// Contains a Serde [`Visitor`](https://docs.rs/serde/latest/serde/de/trait.Visitor.html) that can be used to help
     32 /// deserialize [`dom::Domain`] wrappers.
     33 #[cfg_attr(docsrs, doc(cfg(feature = "serde")))]
     34 #[cfg(feature = "serde")]
     35 pub mod serde;