Struct lair_keystore::dependencies::url::form_urlencoded::Serializer
[−]pub struct Serializer<'a, T> where
T: Target, { /* private fields */ }
Expand description
Implementations
impl<'a, T> Serializer<'a, T> where
T: Target,
impl<'a, T> Serializer<'a, T> where
T: Target,
pub fn new(target: T) -> Serializer<'a, T>
pub fn new(target: T) -> Serializer<'a, T>
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) -> Serializer<'a, T>
pub fn for_suffix(target: T, start_position: usize) -> Serializer<'a, T>
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 Serializer<'a, T>
pub fn clear(&mut self) -> &mut Serializer<'a, T>
Remove any existing name/value pair.
Panics if called after .finish()
.
pub fn encoding_override(
&mut self,
new: Option<&'a (dyn Fn(&str) + 'a)>
) -> &mut Serializer<'a, T>
pub fn encoding_override(
&mut self,
new: Option<&'a (dyn Fn(&str) + 'a)>
) -> &mut Serializer<'a, T>
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 Serializer<'a, T>
pub fn append_pair(&mut self, name: &str, value: &str) -> &mut Serializer<'a, T>
Serialize and append a name/value pair.
Panics if called after .finish()
.
pub fn append_key_only(&mut self, name: &str) -> &mut Serializer<'a, T>
pub fn append_key_only(&mut self, name: &str) -> &mut Serializer<'a, T>
Serialize and append a name of parameter without any value.
Panics if called after .finish()
.
pub fn extend_pairs<I, K, V>(&mut self, iter: I) -> &mut Serializer<'a, T> where
I: IntoIterator,
K: AsRef<str>,
V: AsRef<str>,
<I as IntoIterator>::Item: Borrow<(K, V)>,
pub fn extend_pairs<I, K, V>(&mut self, iter: I) -> &mut Serializer<'a, T> where
I: IntoIterator,
K: AsRef<str>,
V: AsRef<str>,
<I as IntoIterator>::Item: Borrow<(K, V)>,
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 extend_keys_only<I, K>(&mut self, iter: I) -> &mut Serializer<'a, T> where
I: IntoIterator,
K: AsRef<str>,
<I as IntoIterator>::Item: Borrow<K>,
pub fn extend_keys_only<I, K>(&mut self, iter: I) -> &mut Serializer<'a, T> where
I: IntoIterator,
K: AsRef<str>,
<I as IntoIterator>::Item: Borrow<K>,
Serialize and append a number of names without values.
This simply calls append_key_only
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 as Target>::Finished
pub fn finish(&mut self) -> <T as Target>::Finished
If this serializer was constructed with a string, take and return that string.
use 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.
Auto Trait Implementations
impl<'a, T> !RefUnwindSafe for Serializer<'a, T>
impl<'a, T> !Send for Serializer<'a, T>
impl<'a, T> !Sync for Serializer<'a, T>
impl<'a, T> Unpin for Serializer<'a, T> where
T: Unpin,
impl<'a, T> !UnwindSafe for Serializer<'a, T>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn instrument(self, span: Span) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
sourcefn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
fn in_current_span(self) -> Instrumented<Self>ⓘNotable traits for Instrumented<T>impl<T> Future for Instrumented<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
impl<T> Pointable for T
impl<T> Pointable for T
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
fn vzip(self) -> V
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
where
S: Into<Dispatch>,
T: Future, type Output = <T as Future>::Output;
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
fn with_current_subscriber(self) -> WithDispatch<Self>ⓘNotable traits for WithDispatch<T>impl<T> Future for WithDispatch<T> where
T: Future, type Output = <T as Future>::Output;
T: Future, type Output = <T as Future>::Output;
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more