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 Freeze for ServiceBuilder
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
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more