pub trait JsonPacketStream {
// Required methods
fn write_json_packet<T: Serialize>(
&mut self,
message: &T,
) -> Result<(), ActorError>;
fn read_json_packet(&mut self) -> Result<Option<Value>, String>;
}
Required Methods§
fn write_json_packet<T: Serialize>( &mut self, message: &T, ) -> Result<(), ActorError>
fn read_json_packet(&mut self) -> Result<Option<Value>, String>
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.
Implementations on Foreign Types§
Source§impl JsonPacketStream for TcpStream
impl JsonPacketStream for TcpStream
fn write_json_packet<T: Serialize>( &mut self, message: &T, ) -> Result<(), ActorError>
fn read_json_packet(&mut self) -> Result<Option<Value>, String>
Implementors§
impl JsonPacketStream for ClientRequest<'_, '_>
Actors can also send other messages before replying to a request.