# [−][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]

#### `fn contains(&self, byte: u8) -> bool`[src]

### `impl EncodeSet for PATH_SEGMENT_ENCODE_SET`[src]

#### `fn contains(&self, byte: u8) -> bool`[src]

### `impl EncodeSet for QUERY_ENCODE_SET`[src]

#### `fn contains(&self, byte: u8) -> bool`[src]

### `impl EncodeSet for SIMPLE_ENCODE_SET`[src]

#### `fn contains(&self, byte: u8) -> bool`[src]

### `impl EncodeSet for USERINFO_ENCODE_SET`[src]

#### `fn contains(&self, byte: u8) -> bool`[src]

Loading content...

# Help

## Keyboard Shortcuts

`?`
  Show this help dialog
`S`
  Focus the search field
`↑`
  Move up in search results
`↓`
  Move down in search results
`↹`
  Switch tab
`⏎`
  Go to active search result
`+`
  Expand all sections
`-`
  Collapse all sections

## Search Tricks

Prefix searches with a type followed by a colon (e.g., `fn:`) to restrict the search to a given type.

Accepted types are: `fn`, `mod`, `struct`, `enum`, `trait`, `type`, `macro`, and `const`.

Search functions by type signature (e.g., `vec -> usize` or `* -> vec`)

Search multiple things at once by splitting your query with comma (e.g., `str,u8` or `String,struct:Vec,test`)