pub struct ServiceBuilder { /* private fields */ }
Expand description

Service builder.

This builder can be used to manually define a gRPC service in rust code without the use of a .proto file.

Example

let greeter_service = Service::builder()
    .name("Greeter")
    .package("helloworld")
    // Add various methods to the service
    // .method()
    .build();

Implementations§

Set the name for this Service.

This value will be used both as the base for the generated rust types and service trait as well as part of the route for calling this service. Routes have the form: /<package_name>.<service_name>/<method_route_name>

Set the package this Service is part of.

This value will be used as part of the route for calling this service. Routes have the form: /<package_name>.<service_name>/<method_route_name>

Add a comment string that should be included as a doc comment for this Service.

Adds a Method to this Service.

Build a Service.

Panics if name or package weren’t set.

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. 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.

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.