pub trait Message: Serialize + DeserializeOwned {
// Provided methods
fn read<R: BufRead>(
from_proto: for<'i, 'buf> fn(inp: &'i mut R, buf: &'buf mut String) -> Result<Option<&'buf String>>,
inp: &mut R,
buf: &mut String,
) -> Result<Option<Self>> { ... }
fn write<W: Write>(
self,
to_proto: for<'o, 'msg> fn(out: &'o mut W, msg: &'msg str) -> Result<()>,
out: &mut W,
) -> Result<()> { ... }
}
Provided Methods§
fn read<R: BufRead>( from_proto: for<'i, 'buf> fn(inp: &'i mut R, buf: &'buf mut String) -> Result<Option<&'buf String>>, inp: &mut R, buf: &mut String, ) -> Result<Option<Self>>
fn write<W: Write>( self, to_proto: for<'o, 'msg> fn(out: &'o mut W, msg: &'msg str) -> Result<()>, out: &mut W, ) -> Result<()>
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.