Skip to content

Strict parsing, faster ranges, split WASM#26

Merged
Deniskore merged 1 commit into
mainfrom
new-version
May 7, 2026
Merged

Strict parsing, faster ranges, split WASM#26
Deniskore merged 1 commit into
mainfrom
new-version

Conversation

@Deniskore

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR modernizes iptools for stricter parsing and higher performance, expands allocation-free iteration APIs for IpRange, and splits the WebAssembly demo bindings into a separate iptools-wasm workspace crate while keeping the core crate wasm-compatible.

Changes:

  • Tighten IPv4/IPv6 parsing/validation rules (strict dotted-quad IPv4; stricter IPv6 compression + mixed-tail parsing) and gate regex-based validators behind the std feature.
  • Add faster numeric range/bounds helpers and iteration/formatting adapters (*_bounds, next_addr, for_each_addr, addrs_view, contains_strict, iterator shortcuts).
  • Move wasm-bindgen bindings + demo glue into crates/iptools-wasm, update docs/CI/workspace accordingly.

Reviewed changes

Copilot reviewed 26 out of 27 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
WASM.md Updated WASM build/run docs to reflect the new iptools-wasm wrapper crate.
src/lib.rs Adjusted no_std gating so tests can use std even when the std feature is off.
src/error.rs Added V6Subnet to distinguish IPv6 range/subnet construction errors.
src/ipv4/mod.rs Strict dotted-quad IPv4 parsing; faster formatting; new numeric bounds helpers; regex validators behind std.
src/ipv4/tests.rs Expanded tests for strict IPv4 behavior, numeric bounds helpers, and formatting internals.
src/ipv6/mod.rs Stricter IPv6 parsing; faster long2ip; new numeric bounds helpers; regex validators behind std.
src/ipv6/tests.rs Expanded IPv6 tests for strict parsing and parity between regex/optimized validators.
src/iprange/mod.rs New numeric constructors, allocation-free iteration APIs, AddrView adapter, strict containment paths, and updated reserved-range handling.
src/iprange/tests.rs Expanded tests for new constructors/iterators, strict containment behavior, and edge cases.
RS_PY_COMPAT.md Added explicit documentation of behavior differences vs Python iptools.
README.md Updated version/docs; clarified wasm compatibility and added examples for addrs_view.
CHANGELOG.md Added v0.5.0 changelog covering API additions and behavior changes.
Cargo.toml Converted repo into a workspace including crates/iptools-wasm; updated edition/features/deps.
Cargo.lock Updated dependency graph for new workspace and dependency changes.
crates/iptools-wasm/Cargo.toml New wasm-bindgen demo/bindings crate manifest (not published).
crates/iptools-wasm/src/lib.rs New wasm-bindgen bindings previously embedded in iptools core.
crates/iptools-wasm/LICENSE Added license file for the wasm crate.
examples/wasm_demo.html Improved demo UX, initialization safety, and wasm handle cleanup.
benches/ip_bench.rs Refactored benchmarks to include!() split files and added formatting sink usage.
benches/ip_bench/ipv4_core.rs New split benchmark module for IPv4 core helpers.
benches/ip_bench/ipv6_core.rs New split benchmark module for IPv6 core helpers.
benches/ip_bench/ipv4_range.rs New split benchmark module for IPv4 range operations.
benches/ip_bench/ipv6_range.rs New split benchmark module for IPv6 range operations.
benches/ip_bench/ipv4_iteration.rs New split benchmark module for IPv4 iteration/formatting.
benches/ip_bench/ipv6_iteration.rs New split benchmark module for IPv6 iteration/formatting.
.github/workflows/rust.yml Updated CI matrix/toolchain and added wasm/no_std checks.
.github/workflows/ci.yml Updated CI steps to include no_std wasm checks and wasm crate build.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Cargo.toml
Comment thread .github/workflows/ci.yml
Comment thread .github/workflows/rust.yml
Comment thread .github/workflows/rust.yml
Comment thread CHANGELOG.md Outdated
@Deniskore
Deniskore merged commit 459b1b3 into main May 7, 2026
10 checks passed
@Deniskore
Deniskore deleted the new-version branch May 7, 2026 07:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants