mirror of https://github.com/rwf2/Rocket.git
Impl 'From<T>' for contrib 'Json', 'MsgPack'.
This commit is contained in:
parent
630f2c1105
commit
148b01ce80
|
@ -201,6 +201,12 @@ impl<'r, T: Serialize> Responder<'r, 'static> for Json<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T> From<T> for Json<T> {
|
||||||
|
fn from(value: T) -> Self {
|
||||||
|
Json(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<T> Deref for Json<T> {
|
impl<T> Deref for Json<T> {
|
||||||
type Target = T;
|
type Target = T;
|
||||||
|
|
||||||
|
|
|
@ -200,6 +200,12 @@ impl<'v, T: DeserializeOwned + Send> form::FromFormField<'v> for MsgPack<T> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl<T> From<T> for MsgPack<T> {
|
||||||
|
fn from(value: T) -> Self {
|
||||||
|
MsgPack(value)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl<T> Deref for MsgPack<T> {
|
impl<T> Deref for MsgPack<T> {
|
||||||
type Target = T;
|
type Target = T;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue