Skip to main content

MethodDef

Trait MethodDef 

Source
pub trait MethodDef {
    type Input: Message;
    type Output: Message;

    const NAME: &'static str;
    const PATH: ByteString;

    // Provided methods
    fn decode(&self, buf: &mut Bytes) -> Result<Self::Input, DecodeError> { ... }
    fn encode(&self, val: Self::Output, buf: &mut BytePages) { ... }
}
Expand description

Trait for service method definition

Required Associated Constants§

Source

const NAME: &'static str

Source

const PATH: ByteString

Required Associated Types§

Provided Methods§

Source

fn decode(&self, buf: &mut Bytes) -> Result<Self::Input, DecodeError>

Source

fn encode(&self, val: Self::Output, buf: &mut BytePages)

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.

Implementors§