pub trait Method {
type Comment: AsRef<str>;
const CODEC_PATH: &'static str;
// Required methods
fn name(&self) -> &str;
fn identifier(&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 Constants§
Sourceconst CODEC_PATH: &'static str
const CODEC_PATH: &'static str
Path to the codec.
Required Associated Types§
Required Methods§
Sourcefn identifier(&self) -> &str
fn identifier(&self) -> &str
Identifier used to generate type name.
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.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl Method for Method
Available on crate feature prost only.
impl Method for Method
Available on crate feature
prost only.