pub struct HyperServer<T: HyperService + Send + Sync + 'static> {
    pub service: Arc<T>,
}
Expand description

A wrapper for a HyperService trait that keeps a Arc version of the service.

This layer checkcs preconditions of the request (the method and content type) and translates any errors into the Twirp json format.

TODO: Perhaps a clearer name indicating this is a layer?

TODO: Perhaps change to a Tower Layer, although that would require another dependency on tower_layer.

Fields§

§service: Arc<T>

The Arc version of the service

Needed because of hyper Service lifetimes

Implementations§

Create a new service wrapper for the given impl

Trait Implementations§

Responses given by the service.
Errors produced by the service.
The future response value.
Returns Poll::Ready(Ok(())) when the service is able to process requests. Read more
Process the request and return the response asynchronously. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more