de-regex 0.1.0

Regular expression based deserialization for serde
Documentation
  • Coverage
  • 100%
    10 out of 10 items documented3 out of 3 items with examples
  • Size
  • Source code size: 33.85 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 2.08 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • vstroebel/de-regex
    0 1 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • vstroebel

De-Regex

This crate contains a library that deserializes a string into a struct based on a regular expression and serde.

Example

use serde::Deserialize;

#[derive(Deserialize)]
struct Dimensions {
    width: u32,
    height: u32
}

let pattern = r"^(?P<width>\d+)x(?P<height>\d+)$";
let input = "800x600";

let dim: Dimensions = de_regex::from_str(input, pattern).unwrap();

assert_eq!(dim.width, 800);
assert_eq!(dim.height, 600);

License

This project is licensed under either of

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in serde_urlencoded by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.