Cargo Features

[dependencies]
lexical-util = { version = "1.0.3", default-features = false, features = ["std", "power-of-two", "radix", "format", "write-integers", "write-floats", "parse-integers", "parse-floats", "compact", "f16", "lint", "write", "parse", "integers", "floats", "f128"] }

FEATURES
--------
In order to improve compile times, we have separate support for each numeric conversion. Since these features are additive,
if more features are added, separate crates can add support for more features without requiring re-compilation of lexical.

default = std

The std feature is set by default whenever lexical-util is added without default-features = false somewhere in the dependency tree.

std default

Use the standard library.

power-of-two radix?

Add support for numerical conversions with power-of-two strings.

Affects assert::debug_assert_radix, feature_format::CXX_HEX_LITERAL, feature_format::CXX_HEX_STRING, feature_format::CXX20_HEX_LITERAL, feature_format::CXX20_HEX_STRING, feature_format::CXX17_HEX_LITERAL, feature_format::CXX17_HEX_STRING, feature_format::CXX14_HEX_STRING, feature_format::CXX11_HEX_STRING, feature_format::C_HEX_LITERAL, feature_format::C_HEX_STRING, feature_format::C18_HEX_LITERAL, feature_format::C18_HEX_STRING, feature_format::C11_HEX_LITERAL, feature_format::C11_HEX_STRING, feature_format::C99_HEX_LITERAL, feature_format::C99_HEX_STRING, assert::assert_buffer

radix = power-of-two

Add support for numerical conversions with non-decimal strings.

Affects assert::debug_assert_radix

format

Add support for parsing custom numerical formats.

write-integers = integers, write

Add support for writing integers.

write-floats f128? f16? = floats, write

Add support for writing floats.

parse-integers = integers, parse

Add support for parsing integers.

parse-floats f128? f16? = floats, parse

Add support for parsing floats.

compact

Reduce code size at the cost of performance.

f16 = parse-floats, write-floats

Add support for the f16 and b16 half-point floating point numbers.

Affects num::AsPrimitive.as_f16, num::AsPrimitive.as_bf16

lint

Internal only features.
Enable the lint checks.

write write-floats? write-integers?

Add support for writing numbers.

Affects algorithm::copy_to_dst, algorithm::rtrim_char_count, algorithm::ltrim_char_count, assert::assert_buffer, digit::digit_to_char, options::WriteOptions, assert::assert_buffer, digit::digit_to_char_const

parse parse-floats? parse-integers?

Add support for parsing numbers.

Affects digit::char_to_digit, digit::char_is_digit, iterator::Iter, options::ParseOptions

integers parse-integers? write-integers?

Add support for conversions to or from integers.

floats parse-floats? write-floats?

Add support for conversions to or from floats.

Affects num::Float, digit::digit_to_char_const

f128 = parse-floats, write-floats

UNSUPPORTED

Currently unsupported features. Enable support for 128-bit floats. Unsupported and unlikely to ever be. https://github.com/Alexhuszagh/rust-lexical/issues/46 Enable support for 16-bit floats. Enable support for 128-bit floats.