feat: add self-extractor for JSON type (#4123)

This commit is contained in:
chrxn1c
2026-01-17 23:40:53 +03:00
committed by GitHub
parent 452da1acf5
commit 93bafbefd6

View File

@@ -86,6 +86,13 @@ use crate::types::Type;
#[serde(transparent)]
pub struct Json<T: ?Sized>(pub T);
impl<T> Json<T> {
/// Extract the inner value.
pub fn into_inner(self) -> T {
self.0
}
}
impl<T> From<T> for Json<T> {
fn from(value: T) -> Self {
Self(value)