rescue-blanket 0.2.0

Escape values while they are being formatted
Documentation
  • Coverage
  • 100%
    13 out of 13 items documented6 out of 12 items with examples
  • Size
  • Source code size: 12.05 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.84 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • neithernut

rescue-blanket -- escape values while they are being formatted

This crate provides Escaped, a wrapper for escaping special characters and constructs in values while formatting them, and Escaper, a trait for defining escaping logic. In addition, it provides Escapable, an augmentation trait for facilitating wrapping values in Escaped.

The wrapping approach allows escaping arbitrary values implementing Display without the need to buffer them.

Example

use rescue_blanket::Escapable;
println!("foo=\"{}\"", "bar=\"baz\"".escaped_with(char::escape_default));

License

This work is provided under the MIT license. See LICENSE for more details.