Trait Service

Source
pub trait Service: Sized + Message {
    const NAME: &'static str;
    const ID: u64;

    // Required methods
    fn read(b: impl Buf) -> Result<Self, ()>;
    fn write(&self, b: &mut impl BufMut) -> Result<(), ()>;
    fn read_result(b: impl Buf) -> Result<Self::Result, ()>;
    fn write_result(r: &Self::Result, b: &mut impl BufMut) -> Result<(), ()>;

    // Provided methods
    fn to_buf(&self) -> Result<Bytes, ()> { ... }
    fn make_ann_dispatch(&self, to: Uuid) -> Result<Dispatch, ()> { ... }
    fn make_call_dispatch(&self, to: Uuid) -> Result<Dispatch, ()> { ... }
}

Required Associated Constants§

Source

const NAME: &'static str

Source

const ID: u64

Required Methods§

Source

fn read(b: impl Buf) -> Result<Self, ()>

Source

fn write(&self, b: &mut impl BufMut) -> Result<(), ()>

Source

fn read_result(b: impl Buf) -> Result<Self::Result, ()>

Source

fn write_result(r: &Self::Result, b: &mut impl BufMut) -> Result<(), ()>

Provided Methods§

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

Source§

const NAME: &'static str = "quix.process.Process.get"

Source§

const ID: u64 = 12_294_386_532_632_868_296u64

Source§

impl Service for Update

Source§

const NAME: &'static str = "quix.process.Process.update"

Source§

const ID: u64 = 5_537_769_940_034_032_186u64