Function percent_encoding::percent_encode[][src]

pub fn percent_encode<'a>(
    input: &'a [u8],
    ascii_set: &'static AsciiSet
) -> PercentEncode<'a>

Notable traits for PercentEncode<'a>

impl<'a> Iterator for PercentEncode<'a> type Item = &'a str;

Percent-encode the given bytes with the given set.

Non-ASCII bytes and bytes in ascii_set are encoded.

The return type:

Examples

use percent_encoding::{percent_encode, NON_ALPHANUMERIC};

assert_eq!(percent_encode(b"foo bar?", NON_ALPHANUMERIC).to_string(), "foo%20bar%3F");