pub fn encode(input: &str) -> Cow<'_, str>Expand description
Percent-encodes a string per RFC 3986.
Returns the input borrowed when every byte is already in the unreserved set, otherwise an owned encoded copy.
encode_bytes only emits ASCII bytes (unreserved characters or %HH pairs), so
String::from_utf8 always succeeds.