pub fn deserialize<'de, D, T, I>(deserializer: D) -> Result<T, D::Error>
    where
        D: Deserializer<'de>,
        T: FromIterator<I> + Sized,
        I: FromStr,
        I::Err: Display,
    {
        struct Helper<S>(PhantomData<S>);

        impl<'de, S> Visitor<'de> for Helper<S>
        where
            S: FromStr,
            <S as FromStr>::Err: Display,
        {
            type Value = Vec<S>;

            fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
                write!(formatter, "a sequence")
            }

            fn visit_seq<A>(self, seq: A) -> Result<Self::Value, A::Error>
            where
                A: SeqAccess<'de>,
            {
                utils::SeqIter::new(seq)
                    .map(|res| {
                        res.and_then(|value: &str| value.parse::<S>().map_err(Error::custom))
                    })
                    .collect()
            }
        }

        deserializer
            .deserialize_seq(Helper(PhantomData))
            .map(T::from_iter)
    }
/// Deserialize collection T using [FromIterator] and [FromStr] for each element
Deserialize collection T using [FromIterator] and [FromStr] for each element
Deserialize collection T using [ FromIterator ] and [ FromStr ] for each element
pub fn deserialize<'de, D, T, I>(deserializer: D) -> Result<T, D::Error>
    where
        D: Deserializer<'de>,
        T: FromIterator<I> + Sized,
        I: FromStr,
        I::Err: Display,
    {
        struct Helper<S>(PhantomData<S>);
        impl<'de, S> Visitor<'de> for Helper<S>
        where
            S: FromStr,
            <S as FromStr>::Err: Display,
        {
            type Value = Vec<S>;
            fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
                write!(formatter, "a sequence")
            }
            fn visit_seq<A>(self, seq: A) -> Result<Self::Value, A::Error>
            where
                A: SeqAccess<'de>,
            {
                utils::SeqIter::new(seq)
                    .map(|res| {
                        res.and_then(|value: &str| value.parse::<S>().map_err(Error::custom))
                    })
                    .collect()
            }
        }
        deserializer
            .deserialize_seq(Helper(PhantomData))
            .map(T::from_iter)
    }
pub fn deserialize < ' de , D , T , I > ( deserializer : D ) -> Result < T , D :: Error > where D : Deserializer < ' de > , T : FromIterator < I > + Sized , I : FromStr , I :: Err : Display , { struct Helper < S > ( PhantomData < S > ) ; impl < ' de , S > Visitor < ' de > for Helper < S > where S : FromStr , < S as FromStr > :: Err : Display , { type Value = Vec < S > ; fn expecting ( & self , formatter : & mut fmt :: Formatter < ' _ > ) -> fmt :: Result { write ! ( formatter " " ) } fn visit_seq < A > ( self , seq : A ) -> Result < Self :: Value , A :: Error > where A : SeqAccess < ' de > , { utils :: SeqIter :: new ( seq ) . map ( | res | { res . and_then ( | value : & str | value . parse :: < S > ( ) . map_err ( Error :: custom ) ) } ) . collect ( ) } } deserializer . deserialize_seq ( Helper ( PhantomData ) ) . map ( T :: from_iter ) }
Deserialize collection T using [FromIterator] and [FromStr] for each element
Deserialize collection T using [ FromIterator ] and [ FromStr ] for each element
deserializer
D
deserializer
D