pub fn serialize<'a, I, K, V, S>(iter: I, serializer: S) -> Result<S::Ok, S::Error>
    where
        I: IntoIterator<Item = &'a (K, V)>,
        I::IntoIter: ExactSizeIterator,
        K: Serialize + 'a,
        V: Serialize + 'a,
        S: Serializer,
    {
        let mut iter = iter.into_iter();
        let mut map = serializer.serialize_map(Some(iter.len()))?;
        iter.try_for_each(|(key, value)| {
            map.serialize_entry(&key, &value)?;
            Ok(())
        })?;
        map.end()
    }
/// Serialize any iteration of tuples into a map.
Serialize any iteration of tuples into a map.
Serialize any iteration of tuples into a map .
pub fn serialize<'a, I, K, V, S>(iter: I, serializer: S) -> Result<S::Ok, S::Error>
    where
        I: IntoIterator<Item = &'a (K, V)>,
        I::IntoIter: ExactSizeIterator,
        K: Serialize + 'a,
        V: Serialize + 'a,
        S: Serializer,
    {
        let mut iter = iter.into_iter();
        let mut map = serializer.serialize_map(Some(iter.len()))?;
        iter.try_for_each(|(key, value)| {
            map.serialize_entry(&key, &value)?;
            Ok(())
        })?;
        map.end()
    }
pub fn serialize < ' a , I , K , V , S > ( iter : I , serializer : S ) -> Result < S :: Ok , S :: Error > where I : IntoIterator < Item = & ' a ( K , V ) > , I :: IntoIter : ExactSizeIterator , K : Serialize + ' a , V : Serialize + ' a , S : Serializer , { let mut iter = iter . into_iter ( ) ; let mut map = serializer . serialize_map ( Some ( iter . len ( ) ) ) ? ; iter . try_for_each ( | ( key , value ) | { map . serialize_entry ( & key , & value ) ? ; Ok ( ( ) ) } ) ? ; map . end ( ) }
Serialize any iteration of tuples into a map.
Serialize any iteration of tuples into a map .
iter
I
serializer
S
iter
I
serializer
S