Struct RamaGrpcMethodBuilder
pub struct RamaGrpcMethodBuilder { /* private fields */ }Expand description
Method builder.
This builder can be used to manually define gRPC method, which can be added to a gRPC service, in rust code without the use of a .proto file.
Implementations§
§impl RamaGrpcMethodBuilder
impl RamaGrpcMethodBuilder
pub fn with_name(self, name: impl AsRef<str>) -> RamaGrpcMethodBuilder
pub fn with_name(self, name: impl AsRef<str>) -> RamaGrpcMethodBuilder
Set the name for this Method.
This value will be used for generating the client functions for calling this Method.
Generally this is formatted in snake_case.
pub fn set_name(&mut self, name: impl AsRef<str>) -> &mut RamaGrpcMethodBuilder
pub fn set_name(&mut self, name: impl AsRef<str>) -> &mut RamaGrpcMethodBuilder
Set the name for this Method.
This value will be used for generating the client functions for calling this Method.
Generally this is formatted in snake_case.
pub fn with_route_name(
self,
route_name: impl AsRef<str>,
) -> RamaGrpcMethodBuilder
pub fn with_route_name( self, route_name: impl AsRef<str>, ) -> RamaGrpcMethodBuilder
Set the route_name for this Method.
This value will be used as part of the route for calling this method.
Routes have the form: /<package_name>.<service_name>/<method_route_name>
Generally this is formatted in PascalCase.
pub fn set_route_name(
&mut self,
route_name: impl AsRef<str>,
) -> &mut RamaGrpcMethodBuilder
pub fn set_route_name( &mut self, route_name: impl AsRef<str>, ) -> &mut RamaGrpcMethodBuilder
Set the route_name for this Method.
This value will be used as part of the route for calling this method.
Routes have the form: /<package_name>.<service_name>/<method_route_name>
Generally this is formatted in PascalCase.
pub fn with_comment(self, comment: impl AsRef<str>) -> RamaGrpcMethodBuilder
pub fn with_comment(self, comment: impl AsRef<str>) -> RamaGrpcMethodBuilder
Add a comment string that should be included as a doc comment for this Method.
pub fn set_comment(
&mut self,
comment: impl AsRef<str>,
) -> &mut RamaGrpcMethodBuilder
pub fn set_comment( &mut self, comment: impl AsRef<str>, ) -> &mut RamaGrpcMethodBuilder
Add a comment string that should be included as a doc comment for this Method.
pub fn with_input_type(
self,
input_type: impl AsRef<str>,
) -> RamaGrpcMethodBuilder
pub fn with_input_type( self, input_type: impl AsRef<str>, ) -> RamaGrpcMethodBuilder
Set the path to the Rust type that should be use for the Request type of this method.
pub fn set_input_type(
&mut self,
input_type: impl AsRef<str>,
) -> &mut RamaGrpcMethodBuilder
pub fn set_input_type( &mut self, input_type: impl AsRef<str>, ) -> &mut RamaGrpcMethodBuilder
Set the path to the Rust type that should be use for the Request type of this method.
pub fn with_output_type(
self,
output_type: impl AsRef<str>,
) -> RamaGrpcMethodBuilder
pub fn with_output_type( self, output_type: impl AsRef<str>, ) -> RamaGrpcMethodBuilder
Set the path to the Rust type that should be use for the Response type of this method.
pub fn set_output_type(
&mut self,
output_type: impl AsRef<str>,
) -> &mut RamaGrpcMethodBuilder
pub fn set_output_type( &mut self, output_type: impl AsRef<str>, ) -> &mut RamaGrpcMethodBuilder
Set the path to the Rust type that should be use for the Response type of this method.
pub fn with_client_streaming(self) -> RamaGrpcMethodBuilder
pub fn with_client_streaming(self) -> RamaGrpcMethodBuilder
Sets if the Method request from the client is streamed.
pub fn set_client_streaming(&mut self) -> &mut RamaGrpcMethodBuilder
pub fn set_client_streaming(&mut self) -> &mut RamaGrpcMethodBuilder
Sets if the Method request from the client is streamed.
pub fn with_server_streaming(self) -> RamaGrpcMethodBuilder
pub fn with_server_streaming(self) -> RamaGrpcMethodBuilder
Sets if the Method response from the server is streamed.
pub fn set_server_streaming(&mut self) -> &mut RamaGrpcMethodBuilder
pub fn set_server_streaming(&mut self) -> &mut RamaGrpcMethodBuilder
Sets if the Method response from the server is streamed.
pub fn build(self) -> RamaGrpcMethod
pub fn build(self) -> RamaGrpcMethod
Build a Method
Panics if name, route_name, input_type, output_type, or codec_path weren’t set.
Trait Implementations§
§impl Debug for RamaGrpcMethodBuilder
impl Debug for RamaGrpcMethodBuilder
§impl Default for RamaGrpcMethodBuilder
impl Default for RamaGrpcMethodBuilder
§fn default() -> RamaGrpcMethodBuilder
fn default() -> RamaGrpcMethodBuilder
Auto Trait Implementations§
impl Freeze for RamaGrpcMethodBuilder
impl RefUnwindSafe for RamaGrpcMethodBuilder
impl Send for RamaGrpcMethodBuilder
impl Sync for RamaGrpcMethodBuilder
impl Unpin for RamaGrpcMethodBuilder
impl UnwindSafe for RamaGrpcMethodBuilder
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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> ⓘ
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> ⓘ
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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a rama_grpc::Request§impl<T> Pointable for T
impl<T> Pointable for T
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§fn and<P, B, E>(self, other: P) -> And<T, P>
fn and<P, B, E>(self, other: P) -> And<T, P>
Policy that returns Action::Follow only if self and other return
Action::Follow. Read more