Trait JsonPacketStream

Source
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§

Source

fn write_json_packet<T: Serialize>( &mut self, message: &T, ) -> Result<(), ActorError>

Source

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

Implementors§

Source§

impl JsonPacketStream for ClientRequest<'_, '_>

Actors can also send other messages before replying to a request.