Documentation
  • Coverage
  • 0%
    0 out of 10 items documented0 out of 7 items with examples
  • Size
  • Source code size: 8.67 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.69 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • ahaoboy/userscript
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • ahaoboy

Parsing the metadata of the Tampermonkey script

let mut us = UserScript::try_from(
r#"// ==UserScript==
// @author       You
// ==/UserScript=="#,
)
.unwrap();

us.set("author", "Me");

assert_eq!(us.get("author"), Some(&"Me".to_string()))