[−][src]Struct serde_json::Deserializer
A structure that deserializes JSON into Rust values.
Implementations
impl<'de, R> Deserializer<R> where
R: Read<'de>,
[src][−]
R: Read<'de>,
pub fn new(read: R) -> Self
[src][−]
Create a JSON deserializer from one of the possible serde_json input sources.
Typically it is more convenient to use one of these methods instead:
- Deserializer::from_str
- Deserializer::from_bytes
- Deserializer::from_reader
impl<R> Deserializer<IoRead<R>> where
R: Read,
[src][−]
R: Read,
pub fn from_reader(reader: R) -> Self
[src][−]
Creates a JSON deserializer from an io::Read
.
Reader-based deserializers do not support deserializing borrowed types
like &str
, since the std::io::Read
trait has no non-copying methods
-- everything it does involves copying bytes out of the data source.
impl<'a> Deserializer<SliceRead<'a>>
[src][−]
impl<'a> Deserializer<StrRead<'a>>
[src][−]
impl<'de, R: Read<'de>> Deserializer<R>
[src][−]
pub fn end(&mut self) -> Result<()>
[src][−]
The Deserializer::end
method should be called after a value has been fully deserialized.
This allows the Deserializer
to validate that the input stream is at the end or that it
only has trailing whitespace.
pub fn into_iter<T>(self) -> StreamDeserializer<'de, R, T>ⓘNotable traits for StreamDeserializer<'de, R, T>
impl<'de, R, T> Iterator for StreamDeserializer<'de, R, T> where
R: Read<'de>,
T: Deserialize<'de>, type Item = Result<T>;
where
T: Deserialize<'de>,
[src][−]
Notable traits for StreamDeserializer<'de, R, T>
impl<'de, R, T> Iterator for StreamDeserializer<'de, R, T> where
R: Read<'de>,
T: Deserialize<'de>, type Item = Result<T>;
T: Deserialize<'de>,
Turn a JSON deserializer into an iterator over values of type T.
Trait Implementations
impl<'de, 'a, R: Read<'de>> Deserializer<'de> for &'a mut Deserializer<R>
[src][+]
Auto Trait Implementations
impl<R> RefUnwindSafe for Deserializer<R> where
R: RefUnwindSafe,
R: RefUnwindSafe,
impl<R> Send for Deserializer<R> where
R: Send,
R: Send,
impl<R> Sync for Deserializer<R> where
R: Sync,
R: Sync,
impl<R> Unpin for Deserializer<R> where
R: Unpin,
R: Unpin,
impl<R> UnwindSafe for Deserializer<R> where
R: UnwindSafe,
R: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src][+]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src][+]
T: ?Sized,
impl<T> From<T> for T
[src][+]
impl<T, U> Into<U> for T where
U: From<T>,
[src][+]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src][+]
U: Into<T>,
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src][+]
U: TryFrom<T>,