Struct url::form_urlencoded::Serializer [] [src]

pub struct Serializer<T: Target> { /* fields omitted */ }

The application/x-www-form-urlencoded serializer.

Methods

impl<T: Target> Serializer<T>
[src]

[src]

Create a new application/x-www-form-urlencoded serializer for the given target.

If the target is non-empty, its content is assumed to already be in application/x-www-form-urlencoded syntax.

[src]

Create a new application/x-www-form-urlencoded serializer for a suffix of the given target.

If that suffix is non-empty, its content is assumed to already be in application/x-www-form-urlencoded syntax.

[src]

Remove any existing name/value pair.

Panics if called after .finish().

[src]

Set the character encoding to be used for names and values before percent-encoding.

[src]

Serialize and append a name/value pair.

Panics if called after .finish().

[src]

Serialize and append a number of name/value pairs.

This simply calls append_pair repeatedly. This can be more convenient, so the user doesn’t need to introduce a block to limit the scope of Serializer’s borrow of its string.

Panics if called after .finish().

[src]

If this serializer was constructed with a string, take and return that string.

use url::form_urlencoded;
let encoded: String = form_urlencoded::Serializer::new(String::new())
    .append_pair("foo", "bar & baz")
    .append_pair("saison", "Été+hiver")
    .finish();
assert_eq!(encoded, "foo=bar+%26+baz&saison=%C3%89t%C3%A9%2Bhiver");

Panics if called more than once.

Trait Implementations

impl<T: Debug + Target> Debug for Serializer<T>
[src]

[src]

Formats the value using the given formatter. Read more