Trait I3Protocol

Source
pub trait I3Protocol {
    const MAGIC: &'static str = MAGIC;

    // Provided methods
    fn _encode_msg<P>(&self, msg: Msg, payload: Option<P>) -> Vec<u8> 
       where P: AsRef<str> { ... }
    fn encode_msg(&self, msg: Msg) -> Vec<u8>  { ... }
    fn encode_msg_body<P>(&self, msg: Msg, payload: P) -> Vec<u8> 
       where P: AsRef<str> { ... }
    fn encode_msg_json<P>(&self, msg: Msg, payload: P) -> Result<Vec<u8>, Error>
       where P: Serialize { ... }
    fn decode_event(evt_type: u32, payload: Vec<u8>) -> Result<Event, Error> { ... }
}

Provided Associated Constants§

Source

const MAGIC: &'static str = MAGIC

Provided Methods§

Source

fn _encode_msg<P>(&self, msg: Msg, payload: Option<P>) -> Vec<u8>
where P: AsRef<str>,

Source

fn encode_msg(&self, msg: Msg) -> Vec<u8>

Source

fn encode_msg_body<P>(&self, msg: Msg, payload: P) -> Vec<u8>
where P: AsRef<str>,

Source

fn encode_msg_json<P>(&self, msg: Msg, payload: P) -> Result<Vec<u8>, Error>
where P: Serialize,

Source

fn decode_event(evt_type: u32, payload: Vec<u8>) -> Result<Event, Error>

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 I3Protocol for UnixStream

Source§

impl I3Protocol for UnixStream

Implementors§