use-match 0.1.0

Shared match-result primitives for RustUse pattern helpers
Documentation
  • Coverage
  • 48%
    12 out of 25 items documented1 out of 12 items with examples
  • Size
  • Source code size: 7.39 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 514.85 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 3s Average build duration of successful builds.
  • all releases: 3s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Homepage
  • Documentation
  • RustUse/use-pattern
    1 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • CloudBranch

use-match

Reusable match-result primitives for RustUse pattern helpers.

Warning: versions below 0.3.0 are experimental and may change as the workspace matures.

Example Usage

use use_match::{MatchSpan, TextMatch, contains_match, match_len, slice_match};

let span = MatchSpan { start: 0, end: 4 };
let item = TextMatch {
    value: "rust".to_string(),
    span: span.clone(),
};

assert_eq!(match_len(&span), 4);
assert_eq!(slice_match("rustacean", &span), Some("rust"));
assert!(contains_match(&[item], "rust"));

Scope

  • string-backed span and match-result primitives
  • safe span validation and slicing helpers
  • small collection helpers for common match access patterns

Non-Goals

  • regex execution
  • parser AST construction
  • validation result frameworks

License

Licensed under either of the following, at your option:

  • MIT License
  • Apache License, Version 2.0