aboutsummaryrefslogtreecommitdiffstats
path: root/rust/src/lib.rs
diff options
context:
space:
mode:
authorBryan Newbold <bnewbold@robocracy.org>2018-05-15 00:33:33 -0700
committerBryan Newbold <bnewbold@robocracy.org>2018-05-15 00:33:36 -0700
commit33a4cce0b97832f5f0301b318a0a50073ce6b615 (patch)
tree1b6ba7ec5944d2be2d746510e743a7934f453cd0 /rust/src/lib.rs
parent4a1d8f20ab91fda0f4794131144915d0c5214268 (diff)
downloadfatcat-33a4cce0b97832f5f0301b318a0a50073ce6b615.tar.gz
fatcat-33a4cce0b97832f5f0301b318a0a50073ce6b615.zip
revert to v2.3.1 codegen
This reverts back to something compatible with Iron and simple (blocking) parallelism, instead of the new async hyper 0.11 stuff.
Diffstat (limited to 'rust/src/lib.rs')
-rw-r--r--rust/src/lib.rs18
1 files changed, 3 insertions, 15 deletions
diff --git a/rust/src/lib.rs b/rust/src/lib.rs
index ec7193e6..fbff6ab2 100644
--- a/rust/src/lib.rs
+++ b/rust/src/lib.rs
@@ -20,9 +20,6 @@ use diesel::pg::PgConnection;
use diesel::prelude::*;
use dotenv::dotenv;
use std::env;
-use std::io;
-//use hyper;
-//use fatcat_api;
pub fn establish_connection() -> PgConnection {
dotenv().ok();
@@ -31,16 +28,7 @@ pub fn establish_connection() -> PgConnection {
PgConnection::establish(&database_url).expect(&format!("Error connecting to {}", database_url))
}
-pub struct NewService;
-
-impl hyper::server::NewService for NewService {
- type Request = (hyper::Request, fatcat_api::Context);
- type Response = hyper::Response;
- type Error = hyper::Error;
- type Instance = fatcat_api::server::Service<api_server::Server>;
-
- /// Instantiate a new server.
- fn new_service(&self) -> io::Result<Self::Instance> {
- Ok(fatcat_api::server::Service::new(api_server::Server))
- }
+/// Instantiate a new server.
+pub fn server() -> Result<api_server::Server> {
+ Ok(api_server::Server {})
}