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§
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, ()>
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.