Trait tonic_build::Service

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

    // Required methods
    fn name(&self) -> &str;
    fn package(&self) -> &str;
    fn identifier(&self) -> &str;
    fn methods(&self) -> &[Self::Method];
    fn comment(&self) -> &[Self::Comment];
}
Expand description

Service generation trait.

This trait can be implemented and consumed by client::generate and server::generate to allow any codegen module to generate service abstractions.

Required Associated Types§

source

type Comment: AsRef<str>

Comment type.

source

type Method: Method

Method type.

Required Methods§

source

fn name(&self) -> &str

Name of service.

source

fn package(&self) -> &str

Package name of service.

source

fn identifier(&self) -> &str

Identifier used to generate type name.

source

fn methods(&self) -> &[Self::Method]

Methods provided by service.

source

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

Get comments about this item.

Implementations on Foreign Types§

source§

impl Service for Service

§

type Method = Method

§

type Comment = String

source§

fn name(&self) -> &str

source§

fn package(&self) -> &str

source§

fn identifier(&self) -> &str

source§

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

source§

fn methods(&self) -> &[Self::Method]

Implementors§

source§

impl Service for tonic_build::manual::Service