Struct tonic_build::manual::ServiceBuilder
source · 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§
source§impl ServiceBuilder
impl ServiceBuilder
sourcepub fn name(self, name: impl AsRef<str>) -> Self
pub fn name(self, name: impl AsRef<str>) -> Self
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>
sourcepub fn package(self, package: impl AsRef<str>) -> Self
pub fn package(self, package: impl AsRef<str>) -> Self
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>
Trait Implementations§
source§impl Debug for ServiceBuilder
impl Debug for ServiceBuilder
source§impl Default for ServiceBuilder
impl Default for ServiceBuilder
source§fn default() -> ServiceBuilder
fn default() -> ServiceBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for ServiceBuilder
impl Send for ServiceBuilder
impl Sync for ServiceBuilder
impl Unpin for ServiceBuilder
impl UnwindSafe for ServiceBuilder
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more