|
|
@ -12,9 +12,9 @@ where S: MessageSender,
|
|
|
|
println!(">> Created message: {:?}", message);
|
|
|
|
println!(">> Created message: {:?}", message);
|
|
|
|
let serialised = message.serialise(s).expect("Failed to serialise message");
|
|
|
|
let serialised = message.serialise(s).expect("Failed to serialise message");
|
|
|
|
println!(">> Serialised message: {:?}", serialised);
|
|
|
|
println!(">> Serialised message: {:?}", serialised);
|
|
|
|
let binary = serialised.into_bytes();
|
|
|
|
let binary = serialised.into_bytes().expect("Failed to serialize to bytes");
|
|
|
|
println!(">> Written to {} bytes", binary.len());
|
|
|
|
println!(">> Written to {} bytes", binary.len());
|
|
|
|
let read = SerializedMessage::from_bytes(&binary).expect("Failed to read serialised message from binary");
|
|
|
|
let read = SerializedMessage::from_bytes(binary).expect("Failed to read serialised message from binary");
|
|
|
|
println!(">> Read from bytes: {:?}", read);
|
|
|
|
println!(">> Read from bytes: {:?}", read);
|
|
|
|
let deserialised = Message::deserialize(&read, d).expect("Failed to deserialise message");
|
|
|
|
let deserialised = Message::deserialize(&read, d).expect("Failed to deserialise message");
|
|
|
|
println!(">> Deserialised message: {:?}", deserialised);
|
|
|
|
println!(">> Deserialised message: {:?}", deserialised);
|
|
|
|