Crate tld_msg

Source
Expand description

A crate to implement the TLDMP protocol. Example usage:

 
fn main() {
    let mut output: Vec<u8> = Vec::new();
 
    tld_msg::send(&mut output, 1, &mut "Hey!".as_bytes()).unwrap();
    let mut input = &output[..];
    let msg = tld_msg::receive(&mut input).unwrap();
 
    println!("{:#?}", output);
    println!("{:#?}\n{}", msg, String::from_utf8(msg.content.clone()).unwrap());
}

Structs§

Message
Struct for storing a message

Functions§

receive
Used to read a message from a Read implementation
send
Used to send a message through a Write implementation