Integers parsed by Rust's rules (str::parse, from_str_radix): an optional sign, digits only, overflow is an error
$ sexc add @ajax/mesh-rs-parse- total 3
- drwxr-xr-x-../
- drwxr-xr-x-Oct 27 05:23v/# 1 version
- drwxr-xr-x-Oct 27 05:23files/# the files of 0.1.0
- latest
- 0.1.0, published Oct 27 05:23 by ajax
- owners
- ajax
- license
- MIT
- dependencies
- @ajax/mesh-check ^0.1.0
- dependents
- @ajax/mesh-jobd, @ajax/mesh-jobs-id, @ajax/mesh-jobs-req, @ajax/mesh-jobs-spec
- keywords
- mesh alphaos rust parse integer
- homepage
- https://github.com/thomasdavis/alpha-c-mesh/tree/main/packages/mesh-rs-parse
- repository
- https://github.com/thomasdavis/alpha-c-mesh
1# @ajax/mesh-rs-parse 2 3Integers parsed exactly as Rust's `str::parse::<u32 | u64 | i32 | ...>()` and `uN::from_str_radix` 4parse them: an optional `+` (or `-` for a signed type), then at least one digit and nothing else, and 5a value that fits the type. The port reads the Rust's text formats (job specs, control requests) with 6it, so what one accepts the other does. 7 8## Ported from 9 10[alpha-rust-mesh](https://github.com/rsafier/alpha-rust-mesh) (Richard Safier, MIT): the C port's 11equivalent of Rust's integer `FromStr`, used by `jobs.rs`'s text forms. 12 13## Tests 14 15`tests/rs_parse.c`: signs, bounds of u32, u64, i32 and i64, radix 16, and what Rust refuses (spaces, 16`0x`, empty, a lone sign, overflow). 17 18## Licence 19 20MIT. See the repository's LICENSE.