1
0
Fork 0
mirror of https://gitlab.com/msrd0/gotham-restful.git synced 2025-02-23 21:12:28 +00:00
deprecated-gotham-restful/src/lib.rs

64 lines
1.4 KiB
Rust
Raw Normal View History

2019-09-27 16:36:38 +02:00
#[macro_use] extern crate gotham_derive;
#[macro_use] extern crate serde;
2019-09-26 17:24:40 +02:00
pub use hyper::StatusCode;
2019-09-30 20:58:15 +02:00
#[cfg(not(feature = "openapi"))]
use serde::Serialize;
2019-09-26 17:24:40 +02:00
2019-09-30 19:19:06 +02:00
pub mod helper;
2019-09-29 21:15:22 +02:00
#[cfg(feature = "openapi")]
pub mod openapi;
2019-09-30 18:18:10 +02:00
#[cfg(feature = "openapi")]
2019-09-30 20:58:15 +02:00
pub use openapi::{
router::{GetOpenapi, OpenapiRouter},
types::OpenapiType
};
2019-09-29 21:15:22 +02:00
2019-09-26 17:24:40 +02:00
mod resource;
pub use resource::{
Resource,
2019-09-28 13:38:08 +02:00
ResourceReadAll,
ResourceRead,
ResourceCreate,
ResourceUpdateAll,
2019-09-29 19:19:38 +02:00
ResourceUpdate,
ResourceDeleteAll,
ResourceDelete
2019-09-26 17:24:40 +02:00
};
mod result;
2019-09-27 15:35:02 +02:00
pub use result::{ResourceResult, Success};
2019-09-26 17:24:40 +02:00
mod routing;
2019-09-26 17:42:28 +02:00
pub use routing::{DrawResources, DrawResourceRoutes};
2019-09-30 18:18:10 +02:00
#[cfg(feature = "openapi")]
pub use routing::WithOpenapi;
2019-09-30 20:58:15 +02:00
/// A type that can be used inside a request or response body. Implemented for every type
/// that is serializable with serde, however, it is recommended to use the rest_struct!
/// macro to create one.
#[cfg(not(feature = "openapi"))]
pub trait ResourceType : Serialize
{
}
#[cfg(not(feature = "openapi"))]
impl<T : Serialize> ResourceType for T
{
}
/// A type that can be used inside a request or response body. Implemented for every type
/// that is serializable with serde, however, it is recommended to use the rest_struct!
/// macro to create one.
#[cfg(feature = "openapi")]
pub trait ResourceType : OpenapiType
{
}
#[cfg(feature = "openapi")]
impl<T : OpenapiType> ResourceType for T
{
}