[][src]Trait async_coap::uri::escape::StrExt

pub trait StrExt {
    fn escape_uri(&self) -> EscapeUri<EscapeUriSegment>;
fn unescape_uri(&self) -> UnescapeUri;
fn unescape_uri_in_place(&mut self) -> &mut str; }

Trait for str adding URI percent encoding/decoding

See the module-level documentation for more details.

Required methods

Important traits for EscapeUri<'a, X>
fn escape_uri(&self) -> EscapeUri<EscapeUriSegment>

Gets an iterator that performs general-purpose URI percent-encoding.

By default, all characters described by [IETF-RFC3986] as pchars will be escaped, which is appropriate for escaping path segments. This behavior can be modified by appending the following modifiers:

  • full(): Escapes all characters except those which are unreserved.
  • for_query(): Escaping appropriate for the query component.
  • for_fragment(): Escaping appropriate for the fragment component.

The returned iterator will escape ASCII control characters.

Important traits for UnescapeUri<'a>
fn unescape_uri(&self) -> UnescapeUri

Gets an iterator that performs URI percent-decoding.

By default, when the iterator encounters an error the behavior is as follows:

fn unescape_uri_in_place(&mut self) -> &mut str

Experimental: Unescapes the given mutable string in-place, returning a subset of the mutable slice even if it contains encoding errors or illegal characters.

The behavior upon encountering errors is identical to that of unescape_uri().

Loading content...

Implementations on Foreign Types

impl StrExt for str[src]

Loading content...

Implementors

Loading content...