Service

Trait Service 

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

    const CODEC_PATH: &'static str;

    // 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 Constants§

Source

const CODEC_PATH: &'static str

Path to the codec.

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.

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 Service for Service

Available on crate feature prost only.
Source§

const CODEC_PATH: &'static str = PROST_CODEC_PATH

Source§

type Method = Method

Source§

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§