pub fn deserialize_optional<D, I, C>(
    stream_iter: &mut I,
    type_name: &'static str,
    ctx: &mut C
) -> Result<Option<D>, String> where
    C: TestDeserializeContext,
    D: DeserializeOwned + MzReflect,
    I: Iterator<Item = TokenTree>, 
Expand description

If the stream_iter is not empty, deserialize the next TokenTree into a D.

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.