pub struct Direkuta { /* private fields */ }
Expand description
The Direkuta web server itself.
Implementations§
source§impl Direkuta
impl Direkuta
sourcepub fn config(c: impl Fn(&mut Config) + Send + Sync + 'static) -> Self
pub fn config(c: impl Fn(&mut Config) + Send + Sync + 'static) -> Self
Set the configuration of the server.
This is an alternative to Direkuta::new()
and allows you to set custom paths.
Examples
Direkuta::config(|c| {
c.template_path("html/templates");
});
Trait Implementations§
source§impl NewService for Direkuta
impl NewService for Direkuta
source§impl Service for Direkuta
impl Service for Direkuta
§type Future = Box<dyn Future<Item = Response<<Direkuta as Service>::ResBody>, Error = <Direkuta as Service>::Error> + Send + 'static, Global>
type Future = Box<dyn Future<Item = Response<<Direkuta as Service>::ResBody>, Error = <Direkuta as Service>::Error> + Send + 'static, Global>
The
Future
returned by this Service
.Auto Trait Implementations§
impl !RefUnwindSafe for Direkuta
impl Send for Direkuta
impl Sync for Direkuta
impl Unpin for Direkuta
impl !UnwindSafe for Direkuta
Blanket Implementations§
source§impl<N, Ctx> MakeService<Ctx> for Nwhere
N: NewService,
impl<N, Ctx> MakeService<Ctx> for Nwhere
N: NewService,
§type ReqBody = <N as NewService>::ReqBody
type ReqBody = <N as NewService>::ReqBody
The
Payload
body of the http::Request
.§type ResBody = <N as NewService>::ResBody
type ResBody = <N as NewService>::ResBody
The
Payload
body of the http::Response
.§type Error = <N as NewService>::Error
type Error = <N as NewService>::Error
The error type that can be returned by
Service
s.§type Service = <N as NewService>::Service
type Service = <N as NewService>::Service
The resolved
Service
from new_service()
.§type Future = <N as NewService>::Future
type Future = <N as NewService>::Future
The future returned from
new_service
of a Service
.§type MakeError = <N as NewService>::InitError
type MakeError = <N as NewService>::InitError
The error type that can be returned when creating a new
Service
.source§fn poll_ready(
&mut self
) -> Result<Async<()>, <N as MakeService<Ctx>>::MakeError>
fn poll_ready(
&mut self
) -> Result<Async<()>, <N as MakeService<Ctx>>::MakeError>
source§fn make_service(&mut self, _: Ctx) -> <N as MakeService<Ctx>>::Future
fn make_service(&mut self, _: Ctx) -> <N as MakeService<Ctx>>::Future
Create a new
Service
.