pub struct OcpiJson<T>(pub T);Available on crate feature
server only.Expand description
A JSON body, decoded with the path to any offending value.
A body that is not valid JSON is an HTTP 400; a body that is valid JSON but not the object the
endpoint expects is a 2001 in a 200. That is exactly the line the specification draws:
The transport layer ends after a message is correctly parsed into a (semantically unvalidated) JSON structure. When a message does not contain a valid JSON string, the HTTP error
400 - Bad requestMUST be returned.
Tuple Fields§
§0: TTrait Implementations§
Source§impl<T, S> FromRequest<S> for OcpiJson<T>where
T: DeserializeOwned,
S: ContentTypePolicy,
impl<T, S> FromRequest<S> for OcpiJson<T>where
T: DeserializeOwned,
S: ContentTypePolicy,
Auto Trait Implementations§
impl<T> Freeze for OcpiJson<T>where
T: Freeze,
impl<T> RefUnwindSafe for OcpiJson<T>where
T: RefUnwindSafe,
impl<T> Send for OcpiJson<T>where
T: Send,
impl<T> Sync for OcpiJson<T>where
T: Sync,
impl<T> Unpin for OcpiJson<T>where
T: Unpin,
impl<T> UnsafeUnpin for OcpiJson<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for OcpiJson<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