core-json-traits 0.4.1

Traits for working with `JSON`-serialized objects
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use alloc::boxed::Box;

use crate::{Read, Stack, JsonError, Value, JsonDeserialize, JsonStructure};

impl<T: JsonDeserialize> JsonDeserialize for Box<T> {
  fn deserialize<'read, 'parent, B: Read<'read>, S: Stack>(
    value: Value<'read, 'parent, B, S>,
  ) -> Result<Self, JsonError<'read, B, S>> {
    T::deserialize(value).map(Box::new)
  }
}

impl<T: JsonStructure> JsonStructure for Box<T> {}