[−][src]Struct url::form_urlencoded::Serializer
Methods
impl<T: Target> Serializer<T>
[src]
impl<T: Target> Serializer<T>
pub fn new(target: T) -> Self
[src]
pub fn new(target: T) -> Self
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.
pub fn for_suffix(target: T, start_position: usize) -> Self
[src]
pub fn for_suffix(target: T, start_position: usize) -> Self
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.
pub fn clear(&mut self) -> &mut Self
[src]
pub fn clear(&mut self) -> &mut Self
Remove any existing name/value pair.
Panics if called after .finish()
.
pub fn custom_encoding_override<F>(&mut self, encode: F) -> &mut Self where
F: FnMut(&str) -> Cow<[u8]> + 'static,
[src]
pub fn custom_encoding_override<F>(&mut self, encode: F) -> &mut Self where
F: FnMut(&str) -> Cow<[u8]> + 'static,
Set the character encoding to be used for names and values before percent-encoding.
pub fn append_pair(&mut self, name: &str, value: &str) -> &mut Self
[src]
pub fn append_pair(&mut self, name: &str, value: &str) -> &mut Self
Serialize and append a name/value pair.
Panics if called after .finish()
.
pub fn extend_pairs<I, K, V>(&mut self, iter: I) -> &mut Self where
I: IntoIterator,
I::Item: Borrow<(K, V)>,
K: AsRef<str>,
V: AsRef<str>,
[src]
pub fn extend_pairs<I, K, V>(&mut self, iter: I) -> &mut Self where
I: IntoIterator,
I::Item: Borrow<(K, V)>,
K: AsRef<str>,
V: AsRef<str>,
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()
.
pub fn finish(&mut self) -> T::Finished
[src]
pub fn finish(&mut self) -> T::Finished
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]
impl<T: Debug + Target> Debug for Serializer<T>
Auto Trait Implementations
impl<T> !Send for Serializer<T>
impl<T> !Send for Serializer<T>
impl<T> !Sync for Serializer<T>
impl<T> !Sync for Serializer<T>
Blanket Implementations
impl<T, U> Into for T where
U: From<T>,
[src]
impl<T, U> Into for T where
U: From<T>,
impl<T> From for T
[src]
impl<T> From for T
impl<T, U> TryFrom for T where
T: From<U>,
[src]
impl<T, U> TryFrom for T where
T: From<U>,
type Error = !
try_from
)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
try_from
)Performs the conversion.
impl<T> Borrow for T where
T: ?Sized,
[src]
impl<T> Borrow for T where
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
impl<T> BorrowMut for T where
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
try_from
)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
try_from
)Performs the conversion.
impl<T> Any for T where
T: 'static + ?Sized,
[src]
impl<T> Any for T where
T: 'static + ?Sized,
fn get_type_id(&self) -> TypeId
[src]
fn get_type_id(&self) -> TypeId
🔬 This is a nightly-only experimental API. (get_type_id
)
this method will likely be replaced by an associated static
Gets the TypeId
of self
. Read more