Function escape_bytes::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");