whatwg-infra 🦀

License docs.rs CI Security audit codecov

A tiny Rust crate that implements part of the WHATWG Infra Standard.

Install

shell cargo add whatwg-infra

Usage

You can import individual functions:

```rust use whatwginfra::{ isasciitabnewline, isc0control, isc0controlspace, isnoncharacter };

assert!(isasciitabnewline('\t')); assert!(isc0control('\u{0000}')); assert!(isc0controlspace('\u{0020}'));

```

You can also import the traits to get all the functionality, and execute the methods on the types directly.

```rust use whatwg_infra::{InfraScalarValue, InfraStr, InfraUtf16Surrogate};

asserteq!('a'.isasciitabnewline(), false); asserteq!('\u{001E}'.isc0control(), true); asserteq!('\n'.isc0controlspace(), true); asserteq!('\u{CFFFF}'.is_noncharacter(), true); ```

no_std

This crate does not depend on libstd, and can be used in #![no_std] environments.

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.