1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-04-20 23:07:01 +00:00

separate RequestBody and ResponseBody traits from ResourceType

This commit is contained in:
Dominic 2019-10-20 00:54:27 +02:00
parent 3a03dc60fa
commit 57e4f36852
Signed by: msrd0
GPG key ID: DCC8C247452E98F9
6 changed files with 60 additions and 40 deletions

View file

@ -1,4 +1,4 @@
use crate::{ResourceType, StatusCode};
use crate::{ResponseBody, StatusCode};
#[cfg(feature = "openapi")]
use crate::{OpenapiSchema, OpenapiType};
use hyper::Body;
@ -110,7 +110,7 @@ impl<T : ToString> From<T> for ResourceError
}
}
impl<R : ResourceType, E : Error> ResourceResult for Result<R, E>
impl<R : ResponseBody, E : Error> ResourceResult for Result<R, E>
{
fn into_response(self) -> Result<Response, SerdeJsonError>
{
@ -170,7 +170,7 @@ impl<T> From<T> for Success<T>
}
}
impl<T : ResourceType> ResourceResult for Success<T>
impl<T : ResponseBody> ResourceResult for Success<T>
{
fn into_response(self) -> Result<Response, SerdeJsonError>
{