lexical_util/lib.rs
1//! Shared utilities for lexical conversion routines.
2//!
3//! These are not meant to be used publicly for any numeric
4//! conversion routines, but provide optimized math routines,
5//! format packed struct definitions, and custom iterators
6//! for all workspaces.
7//!
8//! # Features
9//!
10//! * `std` - Use the standard library.
11//! * `power-of-two` - Add support for parsing power-of-two integer strings.
12//! * `radix` - Add support for strings of any radix.
13//! * `write-integers` - Add support for writing integers.
14//! * `write-floats` - Add support for writing floats.
15//! * `parse-integers` - Add support for parsing integers.
16//! * `parse-floats` - Add support for parsing floats.
17//! * `compact` - Reduce code size at the cost of performance.
18//!
19//! # Note
20//!
21//! None of this is considered a public API: any of the implementation
22//! details may change release-to-release without major or minor version
23//! changes. Use internal implementation details at your own risk.
24//!
25//! lexical-util mainly exists as an implementation detail for
26//! lexical-core, although its API is stable. If you would like to use
27//! a high-level API that writes to and parses from `String` and `&str`,
28//! respectively, please look at [lexical](https://crates.io/crates/lexical)
29//! instead. If you would like an API that supports multiple numeric
30//! conversions, please look at [lexical-core](https://crates.io/crates/lexical-core)
31//! instead.
32//!
33//! # Version Support
34//!
35//! The minimum, standard, required version is 1.51.0, for const generic
36//! support. Older versions of lexical support older Rust versions.
37
38// We want to have the same safety guarantees as Rust core,
39// so we allow unused unsafe to clearly document safety guarantees.
40#![allow(unused_unsafe)]
41#![cfg_attr(feature = "lint", warn(unsafe_op_in_unsafe_fn))]
42#![cfg_attr(not(feature = "std"), no_std)]
43
44pub mod algorithm;
45pub mod ascii;
46pub mod assert;
47pub mod bf16;
48pub mod constants;
49pub mod digit;
50pub mod div128;
51pub mod error;
52pub mod extended_float;
53pub mod f16;
54pub mod format;
55pub mod iterator;
56pub mod mul;
57pub mod num;
58pub mod options;
59pub mod result;
60pub mod step;
61
62mod api;
63mod feature_format;
64mod format_builder;
65mod format_flags;
66mod noskip;
67mod not_feature_format;
68mod skip;