Trait tonic_build::Method

source ·
pub trait Method {
    type Comment: AsRef<str>;

    // Required methods
    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§

source

type Comment: AsRef<str>

Comment type.

Required Methods§

source

fn name(&self) -> &str

Name of method.

source

fn identifier(&self) -> &str

Identifier used to generate type name.

source

fn codec_path(&self) -> &str

Path to the codec.

source

fn client_streaming(&self) -> bool

Method is streamed by client.

source

fn server_streaming(&self) -> bool

Method is streamed by server.

source

fn comment(&self) -> &[Self::Comment]

Get comments about this item.

source

fn request_response_name( &self, proto_path: &str, compile_well_known_types: bool ) -> (TokenStream, TokenStream)

Type name of request and response.

Implementations on Foreign Types§

source§

impl Method for Method

§

type Comment = String

source§

fn name(&self) -> &str

source§

fn identifier(&self) -> &str

source§

fn codec_path(&self) -> &str

source§

fn client_streaming(&self) -> bool

source§

fn server_streaming(&self) -> bool

source§

fn comment(&self) -> &[Self::Comment]

source§

fn request_response_name( &self, proto_path: &str, compile_well_known_types: bool ) -> (TokenStream, TokenStream)

Implementors§

source§

impl Method for tonic_build::manual::Method