mirror of
https://gitlab.com/msrd0/gotham-restful.git
synced 2025-04-20 06:54:46 +00:00
Reexports
This commit is contained in:
parent
441a42c75e
commit
af28e0d916
16 changed files with 50 additions and 34 deletions
|
@ -1,7 +1,10 @@
|
|||
#[cfg(feature = "openapi")]
|
||||
use crate::OpenapiSchema;
|
||||
use crate::Response;
|
||||
|
||||
use futures_util::future::FutureExt;
|
||||
#[cfg(feature = "openapi")]
|
||||
use gotham::hyper::StatusCode;
|
||||
use mime::{Mime, STAR_STAR};
|
||||
use serde::Serialize;
|
||||
use std::{
|
||||
|
@ -57,8 +60,8 @@ pub trait ResourceResult {
|
|||
fn schema() -> OpenapiSchema;
|
||||
|
||||
#[cfg(feature = "openapi")]
|
||||
fn default_status() -> crate::StatusCode {
|
||||
crate::StatusCode::OK
|
||||
fn default_status() -> StatusCode {
|
||||
StatusCode::OK
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -141,7 +144,7 @@ where
|
|||
}
|
||||
|
||||
#[cfg(feature = "openapi")]
|
||||
fn default_status() -> crate::StatusCode {
|
||||
fn default_status() -> StatusCode {
|
||||
Res::default_status()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,10 @@ use super::{handle_error, ResourceResult};
|
|||
use crate::{IntoResponseError, Response};
|
||||
#[cfg(feature = "openapi")]
|
||||
use crate::{OpenapiSchema, OpenapiType};
|
||||
|
||||
use futures_util::{future, future::FutureExt};
|
||||
#[cfg(feature = "openapi")]
|
||||
use gotham::hyper::StatusCode;
|
||||
use mime::Mime;
|
||||
use std::{fmt::Display, future::Future, pin::Pin};
|
||||
|
||||
|
@ -58,8 +61,8 @@ impl ResourceResult for NoContent {
|
|||
|
||||
/// This will always be a _204 No Content_
|
||||
#[cfg(feature = "openapi")]
|
||||
fn default_status() -> crate::StatusCode {
|
||||
crate::StatusCode::NO_CONTENT
|
||||
fn default_status() -> StatusCode {
|
||||
StatusCode::NO_CONTENT
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -86,7 +89,7 @@ where
|
|||
}
|
||||
|
||||
#[cfg(feature = "openapi")]
|
||||
fn default_status() -> crate::StatusCode {
|
||||
fn default_status() -> StatusCode {
|
||||
NoContent::default_status()
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,10 +1,14 @@
|
|||
use super::{handle_error, IntoResponseError, ResourceResult};
|
||||
#[cfg(feature = "openapi")]
|
||||
use crate::OpenapiSchema;
|
||||
use crate::{FromBody, RequestBody, ResourceType, Response, StatusCode};
|
||||
use crate::{FromBody, RequestBody, ResourceType, Response};
|
||||
|
||||
use futures_core::future::Future;
|
||||
use futures_util::{future, future::FutureExt};
|
||||
use gotham::hyper::body::{Body, Bytes};
|
||||
use gotham::hyper::{
|
||||
body::{Body, Bytes},
|
||||
StatusCode
|
||||
};
|
||||
use mime::Mime;
|
||||
#[cfg(feature = "openapi")]
|
||||
use openapiv3::{SchemaKind, StringFormat, StringType, Type, VariantOrUnknownOrEmpty};
|
||||
|
|
|
@ -1,8 +1,10 @@
|
|||
use super::{handle_error, into_response_helper, ResourceResult};
|
||||
#[cfg(feature = "openapi")]
|
||||
use crate::OpenapiSchema;
|
||||
use crate::{result::ResourceError, Response, ResponseBody, StatusCode};
|
||||
use crate::{result::ResourceError, Response, ResponseBody};
|
||||
|
||||
use futures_core::future::Future;
|
||||
use gotham::hyper::StatusCode;
|
||||
use mime::{Mime, APPLICATION_JSON};
|
||||
use std::{error::Error, fmt::Display, pin::Pin};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue