Deserialize the next `TokenTree` into a `D` object. See [`to_json`] for the object spec syntax. `type_name` should be `D` in string form. `stream_iter` will advance by one `TokenTree` no matter the result.
(
stream_iter: &mut I,
type_name: &'static str,
ctx: &mut C,
)
| 141 | /// |
| 142 | /// `stream_iter` will advance by one `TokenTree` no matter the result. |
| 143 | pub fn deserialize<D, I, C>( |
| 144 | stream_iter: &mut I, |
| 145 | type_name: &'static str, |
| 146 | ctx: &mut C, |
| 147 | ) -> Result<D, String> |
| 148 | where |
| 149 | C: TestDeserializeContext, |
| 150 | D: DeserializeOwned + MzReflect, |
| 151 | I: Iterator<Item = TokenTree>, |
| 152 | { |
| 153 | deserialize_optional(stream_iter, type_name, ctx)? |
| 154 | .ok_or_else(|| format!("Empty spec for type {}", type_name)) |
| 155 | } |
| 156 | |
| 157 | /// Converts the next part of the stream into JSON deserializable into an object |
| 158 | /// of type `type_name`. |
no test coverage detected