Trait hrpc::server::MakeRoutes
source · [−]pub trait MakeRoutes: Send + 'static {
fn make_routes(&self) -> Routes;
fn combine_with<Other>(self, other: Other) -> ServiceStack<Other, Self>
where
Other: MakeRoutes,
Self: Sized,
{ ... }
fn into_make_service(self) -> IntoMakeService<Self>
where
Self: Sized,
{ ... }
fn layer<S, L>(self, layer: L) -> LayeredService<S, L, Self>
where
L: Layer<HrpcService, Service = S> + Clone + Sync + Send + 'static,
S: Service<BoxRequest, Response = BoxResponse, Error = Infallible> + Send + 'static,
S::Future: Send,
Self: Sized,
{ ... }
}
Expand description
The core trait of hrpc-rs
servers. This trait acts as a tower::MakeService
,
it can produce a set of Routes
and can be combined with other MakeRoutes
s.
Not to be confused with tower::Service
.
Required methods
fn make_routes(&self) -> Routes
fn make_routes(&self) -> Routes
Creates a Routes
, which will be used to build a RoutesFinalized
instance.
Provided methods
fn combine_with<Other>(self, other: Other) -> ServiceStack<Other, Self> where
Other: MakeRoutes,
Self: Sized,
fn combine_with<Other>(self, other: Other) -> ServiceStack<Other, Self> where
Other: MakeRoutes,
Self: Sized,
Combines this server with another server.
fn into_make_service(self) -> IntoMakeService<Self> where
Self: Sized,
fn into_make_service(self) -> IntoMakeService<Self> where
Self: Sized,
Turns this server into a type that implements MakeService
, so that
it can be used with hyper
.
fn layer<S, L>(self, layer: L) -> LayeredService<S, L, Self> where
L: Layer<HrpcService, Service = S> + Clone + Sync + Send + 'static,
S: Service<BoxRequest, Response = BoxResponse, Error = Infallible> + Send + 'static,
S::Future: Send,
Self: Sized,
fn layer<S, L>(self, layer: L) -> LayeredService<S, L, Self> where
L: Layer<HrpcService, Service = S> + Clone + Sync + Send + 'static,
S: Service<BoxRequest, Response = BoxResponse, Error = Infallible> + Send + 'static,
S::Future: Send,
Self: Sized,
Layers this server with a layer.
If your layer does not implement Clone
, you can wrap it using
HrpcLayer::new
.