escape

Function escape 

Source
pub fn escape<I>(i: I) -> Vec<u8>
where I: IntoIterator, I::Item: Borrow<u8>,
Expand description

Escape the bytes.

See crate for the exact rules.

ยงExample

let str = b"hello\xc3world";
let escaped = escape_bytes::escape(str);
assert_eq!(escaped, br"hello\xc3world");