Module bytes

Shlex and friends for byte strings.

This is used internally by the outer module, and may be more convenient if you are working with byte slices ([u8]) or types that are wrappers around bytes, such as OsStr:

#[cfg(unix)] {
    use shlex::bytes::quote;
    use std::ffi::OsStr;
    use std::os::unix::ffi::OsStrExt;

    // `\x80` is invalid in UTF-8.
    let os_str = OsStr::from_bytes(b"a\x80b c");
    assert_eq!(quote(os_str.as_bytes()), &b"'a\x80b c'"[..]);
}

(On Windows, OsStr uses 16 bit wide characters so this will not work.)

Structs

Functions