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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
//! Shared utilities for lexical conversion routines.
//!
//! These are not meant to be used publicly for any numeric
//! conversion routines, but provide optimized math routines,
//! format packed struct definitions, and custom iterators
//! for all workspaces.
//!
//! # Features
//!
//! * `power-of-two` - Add support for parsing and writing power-of-two integer
//! strings.
//! * `radix` - Add support for parsing and writing strings of any radix.
//! * `format` - Add support for custom number formats.
//! * `write-integers` - Add support for writing integers (used for
//! [`lexical-write-integer`]).
//! * `write-floats` - Add support for writing floats (used for
//! [`lexical-write-float`]).
//! * `parse-integers` - Add support for parsing integers (used for
//! [`lexical-parse-integer`]).
//! * `parse-floats` - Add support for parsing floats (used for
//! [`lexical-write-float`]).
//! * `compact` - Reduce code size at the cost of performance.
//! * `f16` - Enable support for half-precision [`f16`][`ieee-f16`] and
//! [`bf16`][`brain-float`] floats.
//! * `std` (Default) - Disable to allow use in a [`no_std`] environment.
//!
//! [`no_std`]: https://docs.rust-embedded.org/book/intro/no-std.html
//! [`ieee-f16`]: https://en.wikipedia.org/wiki/Half-precision_floating-point_format
//! [`brain-float`]: https://en.wikipedia.org/wiki/Bfloat16_floating-point_format
//!
//! # Public API
//!
//! [`lexical-util`] mainly exists as an implementation detail for
//! the other lexical crates, although its API is mostly stable. If you would
//! like to use a high-level API that writes to and parses from [`String`] and
//! [`str`], respectively, please look at [`lexical`] instead. If you would like
//! an API that supports multiple numeric conversions without a dependency on
//! [`alloc`], please look at [`lexical-core`] instead.
//!
//! <div class="warning">
//!
//! Any undocumented, implementation details may change release-to-release
//! without major or minor version changes. Use internal implementation details
//! at your own risk. Any changes other than to [`NumberFormatBuilder`],
//! [`NumberFormat`], [`mod@format`], and [`mod@options`] will not be considered
//! a breaking change.
//!
//! </div>
//!
//! # Version Support
//!
//! The minimum, standard, required version is [`1.63.0`][`rust-1.63.0`], for
//! const generic support. Older versions of lexical support older Rust
//! versions.
//!
//! # Safety Guarantees
//!
//! For a detailed breakdown on the use of [`unsafe`], how and why our traits
//! are implemented safely, and how to verify this, see [`Safety`].
//!
//! [`lexical`]: https://crates.io/crates/lexical
//! [`lexical-parse-float`]: https://crates.io/crates/lexical-parse-float
//! [`lexical-parse-integer`]: https://crates.io/crates/lexical-parse-integer
//! [`lexical-write-float`]: https://crates.io/crates/lexical-write-float
//! [`lexical-write-integer`]: https://crates.io/crates/lexical-write-integer
//! [`lexical-core`]: https://crates.io/crates/lexical-core
//! [`lexical-util`]: https://crates.io/crates/lexical-util
//! [`rust-1.63.0`]: https://blog.rust-lang.org/2022/08/11/Rust-1.63.0.html
//! [`alloc`]: https://doc.rust-lang.org/alloc/
//! [`String`]: https://doc.rust-lang.org/alloc/string/struct.String.html
//! [`Safety`]: https://github.com/Alexhuszagh/rust-lexical/blob/main/lexical-util/docs/Safety.md
//! [`unsafe`]: https://doc.rust-lang.org/book/ch19-01-unsafe-rust.html
// FIXME: Implement clippy/allow reasons once we drop support for 1.80.0 and below
// Clippy reasons were stabilized in 1.81.0.
// We want to have the same safety guarantees as Rust core,
// so we allow unused unsafe to clearly document safety guarantees.
pub use ;
pub use Error;
pub use ;
pub use ParseOptions;
pub use WriteOptions;
pub use Result;