pub struct Json<T>(pub T);Expand description
Json is a type wrapper to implement Footer for all types that implement
serde_core::Serialize and serde_core::Deserialize
When using a JSON footer, you should be aware of the risks of parsing user provided JSON. https://github.com/paseto-standard/paseto-spec/blob/master/docs/02-Implementation-Guide/01-Payload-Processing.md#storing-json-in-the-footer.
Currently, this uses serde_json internally, which by default offers a stack-overflow protection limit on parsing JSON.
You should also parse into a known struct layout, and avoid arbitrary key-value mappings.
If you need stricter checks, you can make your own Footer encodings that give access to the bytes before
the footer is decoded.
Tuple Fields§
§0: TTrait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Json<T>where
T: Freeze,
impl<T> RefUnwindSafe for Json<T>where
T: RefUnwindSafe,
impl<T> Send for Json<T>where
T: Send,
impl<T> Sync for Json<T>where
T: Sync,
impl<T> Unpin for Json<T>where
T: Unpin,
impl<T> UnwindSafe for Json<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more