Trait Endpoint

Source
pub trait Endpoint {
    type Request: Schema;
    type Response: Schema;

    const PATH: &'static str;
    const REQ_KEY: Key;
    const RESP_KEY: Key;
    const REQ_KEY4: Key4 = _;
    const REQ_KEY2: Key2 = _;
    const REQ_KEY1: Key1 = _;
    const RESP_KEY4: Key4 = _;
    const RESP_KEY2: Key2 = _;
    const RESP_KEY1: Key1 = _;
}
Expand description

A marker trait denoting a single endpoint

Typically used with the endpoint macro.

Required Associated Constants§

Source

const PATH: &'static str

The path associated with this Endpoint

Source

const REQ_KEY: Key

The unique Key identifying the Request

Source

const RESP_KEY: Key

The unique Key identifying the Response

Provided Associated Constants§

Source

const REQ_KEY4: Key4 = _

The unique Key4 identifying the Request

Source

const REQ_KEY2: Key2 = _

The unique Key2 identifying the Request

Source

const REQ_KEY1: Key1 = _

The unique Key1 identifying the Request

Source

const RESP_KEY4: Key4 = _

The unique Key4 identifying the Response

Source

const RESP_KEY2: Key2 = _

The unique Key2 identifying the Response

Source

const RESP_KEY1: Key1 = _

The unique Key1 identifying the Response

Required Associated Types§

Source

type Request: Schema

The type of the Request (client to server)

Source

type Response: Schema

The type of the Response (server to client)

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§

Source§

impl Endpoint for GetAllSchemasEndpoint

Source§

const PATH: &'static str = "postcard-rpc/schemas/get"

Source§

const REQ_KEY: Key

Source§

const RESP_KEY: Key

Source§

type Request = ()

Source§

type Response = SchemaTotals

Source§

impl Endpoint for PingEndpoint

Source§

const PATH: &'static str = "postcard-rpc/ping"

Source§

const REQ_KEY: Key

Source§

const RESP_KEY: Key

Source§

type Request = u32

Source§

type Response = u32