mirror of
https://github.com/launchbadge/sqlx.git
synced 2026-04-15 17:00:33 +00:00
feat: add self-extractor for JSON type (#4123)
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user