Trait tonic_build::Method
source · pub trait Method {
type Comment: AsRef<str>;
fn name(&self) -> &str;
fn identifier(&self) -> &str;
fn codec_path(&self) -> &str;
fn client_streaming(&self) -> bool;
fn server_streaming(&self) -> bool;
fn comment(&self) -> &[Self::Comment];
fn request_response_name(
&self,
proto_path: &str,
compile_well_known_types: bool
) -> (TokenStream, TokenStream);
}
Expand description
Method generation trait.
Each service contains a set of generic
Methods
’s that will be used by codegen
to generate abstraction implementations for
the provided methods.
Required Associated Types§
Required Methods§
sourcefn identifier(&self) -> &str
fn identifier(&self) -> &str
Identifier used to generate type name.
sourcefn codec_path(&self) -> &str
fn codec_path(&self) -> &str
Path to the codec.
sourcefn client_streaming(&self) -> bool
fn client_streaming(&self) -> bool
Method is streamed by client.
sourcefn server_streaming(&self) -> bool
fn server_streaming(&self) -> bool
Method is streamed by server.
sourcefn request_response_name(
&self,
proto_path: &str,
compile_well_known_types: bool
) -> (TokenStream, TokenStream)
fn request_response_name(
&self,
proto_path: &str,
compile_well_known_types: bool
) -> (TokenStream, TokenStream)
Type name of request and response.