[][src]Trait percent_encoding::EncodeSet

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

fn contains(&self, byte: u8) -> bool

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

Loading content...

Implementors

impl EncodeSet for DEFAULT_ENCODE_SET[src]

impl EncodeSet for PATH_SEGMENT_ENCODE_SET[src]

impl EncodeSet for QUERY_ENCODE_SET[src]

impl EncodeSet for SIMPLE_ENCODE_SET[src]

impl EncodeSet for USERINFO_ENCODE_SET[src]

Loading content...