Skip to content
JavaScript-interoperable integer types for Rust
Branch: master
Clone or download
jplatte Don't deny warnings by default
… but make the CI check if that would break things in future versions
Latest commit 38f152b Jul 18, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
ext_tests Move serde tests into a separate crate Jun 16, 2019
src Don't deny warnings by default Jul 18, 2019
.gitignore Initial commit Jun 15, 2019
.travis.yml Don't deny warnings by default Jul 18, 2019 Update Jul 7, 2019
Cargo.toml Add rocket_04 feature Jul 7, 2019
LICENSE Add LICENSE file Jun 16, 2019 Specify MSRV of 1.34.2 Jul 7, 2019


Build Status Latest Version Docs

Crate js_int provides JavaScript-interoperable integer types.

JavaScript does not have native integers. Instead it represents all numeric values with a single Number type which is represented as an IEEE 754 floating-point value. Rust's i64 and u64 types can contain values outside the range of what can be represented in a JavaScript Number.

This crate provides the types Int and UInt which wrap i64 and u64, respectively. These types add bounds checking to ensure the contained value is within the range representable by a JavaScript Number. They provide useful trait implementations to easily convert from Rust's primitive integer types.

This crate requires rustc >= 1.34.2.

This crate is no_std-compatible with default-features = false. This will disable the std feature, which at the time of writing will only omit the implementations of std::error::Error for ParseIntError and TryFromIntError.

(De-)Serialization via serde is supported via the serde feature, even without the std feature.

Deserialization of Int and UInt form values and path parameters for users of the Rocket web framework version 0.4 are supported via the rocket_04 feature.

You can’t perform that action at this time.