Method

Trait Method 

Source
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§

Source

const CODEC_PATH: &'static str

Path to the codec.

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 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.

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.
Source§

const CODEC_PATH: &'static str = PROST_CODEC_PATH

Source§

type Comment = String

Source§

fn name(&self) -> &str

Source§

fn identifier(&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§