Skip to main content

encode_into

Function encode_into 

Source
pub fn encode_into<W: Write>(text: &str, out: &mut W) -> Result
Expand description

Encodes one component (a name or a value) without allocating: every byte outside ASCII alphanumerics and *-._ is percent-encoded with uppercase hex, and space is written as +. Runs of bytes that need no escape are written with one write_str.

§Errors

Only what out returns.

§Examples

let mut s = String::new();
form_net::encode_into("a b&c", &mut s).unwrap();
assert_eq!(s, "a+b%26c");