substr 1.0.0

Handle substrings as ranges without lifetimes
Documentation
  • Coverage
  • 66.67%
    6 out of 9 items documented0 out of 7 items with examples
  • Size
  • Source code size: 10.69 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.61 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • mrnerdhair/substr
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • reidrankin

Encapsulates the concept of a substring of a certain length found at a given offset, which can be useful when this information cannot be directly coupled to the lifetime of the orignal string it was derived from. This can be useful, for example, when the section of a string which caused a parsing error must be reported in a manner which must survive the lifetime of the original parsed string.

This may sound like an odd set of requirements, but it notably occurs when implementing an external trait (which cannot be modified to take a lifetime parameter) which contains a function which takes a &str -- like, say, std::str::FromStr.