RFC6570 Level 2 - Rust
Overview
A Rust library for validating and processing strings as RFC6570-compliant URIs (up to level 2).
Versioning
This project follows Semantic Versioning principals starting with v1.0.0
Repository information
This repository is located on GitLab.com.
Usage
To use this library, instantiate an UriTemplate
with a relevant string. From here, the result can be "discarded" if only validation of the input string is needed, or a list of contained expressions or variables can be retrieved with expressions()
or variables()
. Finally, the URI template can be expanded by called expand()
with a HashMap<&str, &str>
of variables and values.
use UriTemplate;
let template = new?;
// What variables are available?
let variables: = template.variables.collect;
assert_eq!;
let var_map = .iter.cloned.collect;
// Expand the template
let uri = template.expand;
assert_eq!;