Trait secp256k1_zkp::serde::de::SeqAccess [−][src]
pub trait SeqAccess<'de> { type Error: Error; pub fn next_element_seed<T>(
&mut self,
seed: T
) -> Result<Option<<T as DeserializeSeed<'de>>::Value>, Self::Error>
where
T: DeserializeSeed<'de>; pub fn next_element<T>(&mut self) -> Result<Option<T>, Self::Error>
where
T: Deserialize<'de>, { ... } pub fn size_hint(&self) -> Option<usize> { ... } }
Provides a Visitor
access to each element of a sequence in the input.
This is a trait that a Deserializer
passes to a Visitor
implementation,
which deserializes each item in a sequence.
Lifetime
The 'de
lifetime of this trait is the lifetime of data that may be
borrowed by deserialized sequence elements. See the page Understanding
deserializer lifetimes for a more detailed explanation of these lifetimes.
Example implementation
The example data format presented on the website demonstrates an
implementation of SeqAccess
for a basic JSON data format.
Associated Types
type Error: Error
[src]
The error type that can be returned if some error occurs during deserialization.
Required methods
pub fn next_element_seed<T>(
&mut self,
seed: T
) -> Result<Option<<T as DeserializeSeed<'de>>::Value>, Self::Error> where
T: DeserializeSeed<'de>,
[src]
&mut self,
seed: T
) -> Result<Option<<T as DeserializeSeed<'de>>::Value>, Self::Error> where
T: DeserializeSeed<'de>,
This returns Ok(Some(value))
for the next value in the sequence, or
Ok(None)
if there are no more remaining items.
Deserialize
implementations should typically use
SeqAccess::next_element
instead.
Provided methods
pub fn next_element<T>(&mut self) -> Result<Option<T>, Self::Error> where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
This returns Ok(Some(value))
for the next value in the sequence, or
Ok(None)
if there are no more remaining items.
This method exists as a convenience for Deserialize
implementations.
SeqAccess
implementations should not override the default behavior.
pub fn size_hint(&self) -> Option<usize>
[src]
Returns the number of elements remaining in the sequence, if known.
Implementations on Foreign Types
impl<'de, 'a, A> SeqAccess<'de> for &'a mut A where
A: SeqAccess<'de>,
[src]
impl<'de, 'a, A> SeqAccess<'de> for &'a mut A where
A: SeqAccess<'de>,
[src]type Error = <A as SeqAccess<'de>>::Error
pub fn next_element_seed<T>(
&mut self,
seed: T
) -> Result<Option<<T as DeserializeSeed<'de>>::Value>, <&'a mut A as SeqAccess<'de>>::Error> where
T: DeserializeSeed<'de>,
[src]
&mut self,
seed: T
) -> Result<Option<<T as DeserializeSeed<'de>>::Value>, <&'a mut A as SeqAccess<'de>>::Error> where
T: DeserializeSeed<'de>,
pub fn next_element<T>(
&mut self
) -> Result<Option<T>, <&'a mut A as SeqAccess<'de>>::Error> where
T: Deserialize<'de>,
[src]
&mut self
) -> Result<Option<T>, <&'a mut A as SeqAccess<'de>>::Error> where
T: Deserialize<'de>,
pub fn size_hint(&self) -> Option<usize>
[src]
Implementors
impl<'de, I, E> SeqAccess<'de> for MapDeserializer<'de, I, E> where
E: Error,
I: Iterator,
<I as Iterator>::Item: Pair,
<<I as Iterator>::Item as Pair>::First: IntoDeserializer<'de, E>,
<<I as Iterator>::Item as Pair>::Second: IntoDeserializer<'de, E>,
[src]
impl<'de, I, E> SeqAccess<'de> for MapDeserializer<'de, I, E> where
E: Error,
I: Iterator,
<I as Iterator>::Item: Pair,
<<I as Iterator>::Item as Pair>::First: IntoDeserializer<'de, E>,
<<I as Iterator>::Item as Pair>::Second: IntoDeserializer<'de, E>,
[src]type Error = E
pub fn next_element_seed<T>(
&mut self,
seed: T
) -> Result<Option<<T as DeserializeSeed<'de>>::Value>, <MapDeserializer<'de, I, E> as SeqAccess<'de>>::Error> where
T: DeserializeSeed<'de>,
[src]
&mut self,
seed: T
) -> Result<Option<<T as DeserializeSeed<'de>>::Value>, <MapDeserializer<'de, I, E> as SeqAccess<'de>>::Error> where
T: DeserializeSeed<'de>,
pub fn size_hint(&self) -> Option<usize>
[src]
impl<'de, I, T, E> SeqAccess<'de> for SeqDeserializer<I, E> where
E: Error,
T: IntoDeserializer<'de, E>,
I: Iterator<Item = T>,
[src]
impl<'de, I, T, E> SeqAccess<'de> for SeqDeserializer<I, E> where
E: Error,
T: IntoDeserializer<'de, E>,
I: Iterator<Item = T>,
[src]type Error = E
pub fn next_element_seed<V>(
&mut self,
seed: V
) -> Result<Option<<V as DeserializeSeed<'de>>::Value>, <SeqDeserializer<I, E> as SeqAccess<'de>>::Error> where
V: DeserializeSeed<'de>,
[src]
&mut self,
seed: V
) -> Result<Option<<V as DeserializeSeed<'de>>::Value>, <SeqDeserializer<I, E> as SeqAccess<'de>>::Error> where
V: DeserializeSeed<'de>,