Trait percent_encoding::EncodeSet [] [src]

pub trait EncodeSet: Clone {
    fn contains(&self, byte: u8) -> bool;
}

Represents a set of characters / bytes that should be percent-encoded.

See encode sets specification.

Different characters need to be encoded in different parts of an URL. For example, a literal ? question mark in an URL’s path would indicate the start of the query string. A question mark meant to be part of the path therefore needs to be percent-encoded. In the query string however, a question mark does not have any special meaning and does not need to be percent-encoded.

A few sets are defined in this module. Use the define_encode_set! macro to define different ones.

Required Methods

Called with UTF-8 bytes rather than code points. Should return true for all non-ASCII bytes.

Implementors