cjdns::structs
pub fn decode<A>(bytes: Vec<u8>) -> Result<A, Error> where A: Decodable,
Decodes a bencoded Message
bytes
use cjdns::decode; use cjdns::structs::Pong; let msg = String::from("d000001:q4:ponge"); let bytes = msg.into_bytes(); let x: Pong = decode(bytes).unwrap(); println!("{:?}", x);