devtools::protocol

Trait JsonPacketStream

Source
pub trait JsonPacketStream {
    // Required methods
    fn write_json_packet<T: Serialize>(
        &mut self,
        obj: &T,
    ) -> Result<(), Box<dyn Error>>;
    fn write_merged_json_packet<T: Serialize, U: Serialize>(
        &mut self,
        base: &T,
        extra: &U,
    ) -> Result<(), Box<dyn Error>>;
    fn read_json_packet(&mut self) -> Result<Option<Value>, String>;
}

Required Methods§

Source

fn write_json_packet<T: Serialize>( &mut self, obj: &T, ) -> Result<(), Box<dyn Error>>

Source

fn write_merged_json_packet<T: Serialize, U: Serialize>( &mut self, base: &T, extra: &U, ) -> Result<(), Box<dyn Error>>

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

Source§

fn write_json_packet<T: Serialize>( &mut self, obj: &T, ) -> Result<(), Box<dyn Error>>

Source§

fn write_merged_json_packet<T: Serialize, U: Serialize>( &mut self, base: &T, extra: &U, ) -> Result<(), Box<dyn Error>>

Source§

fn read_json_packet(&mut self) -> Result<Option<Value>, String>

Implementors§