diff options
Diffstat (limited to 'rust/fatcat-api/examples/server_lib/mod.rs')
-rw-r--r-- | rust/fatcat-api/examples/server_lib/mod.rs | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/rust/fatcat-api/examples/server_lib/mod.rs b/rust/fatcat-api/examples/server_lib/mod.rs index a45fbe50..5291637e 100644 --- a/rust/fatcat-api/examples/server_lib/mod.rs +++ b/rust/fatcat-api/examples/server_lib/mod.rs @@ -7,20 +7,8 @@ mod errors { } pub use self::errors::*; -use fatcat; -use hyper; -use std::io; -pub struct NewService; - -impl hyper::server::NewService for NewService { - type Request = (hyper::Request, fatcat::Context); - type Response = hyper::Response; - type Error = hyper::Error; - type Instance = fatcat::server::Service<server::Server>; - - /// Instantiate a new server. - fn new_service(&self) -> io::Result<Self::Instance> { - Ok(fatcat::server::Service::new(server::Server)) - } +/// Instantiate a new server. +pub fn server() -> Result<server::Server> { + Ok(server::Server {}) } |