pub struct ServiceRequest<T: Message> {
    pub uri: Uri,
    pub method: Method,
    pub version: Version,
    pub headers: HeaderMap,
    pub input: T,
}
Expand description

A request with HTTP info and a proto request payload object.

Fields§

§uri: Uri

The URI of the original request

When using a client, this will be overridden with the proper URI. It is only valuable for servers.

§method: Method

The request method; should always be POST.

§version: Version

The HTTP version, rarely changed from the default.

§headers: HeaderMap

The set of headers

Should always at least have Content-Type. Clients will override Content-Length on serialization.

§input: T

The request body as a proto Message, representing the arguments of the proto rpc.

Implementations§

Create new service request with the given input object

This automatically sets the Content-Type header as application/protobuf.

Copy this request with a different input value

Serialize into a hyper request.

Trait Implementations§

Formats the value using the given formatter. Read more
Converts to this type from the input type.

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