|
|
|
@ -12,9 +12,9 @@ where S: MessageSender,
|
|
|
|
|
println!(">> Created message: {:?}", message);
|
|
|
|
|
let serialised = message.serialise(s).expect("Failed to serialise message");
|
|
|
|
|
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());
|
|
|
|
|
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);
|
|
|
|
|
let deserialised = Message::deserialize(&read, d).expect("Failed to deserialise message");
|
|
|
|
|
println!(">> Deserialised message: {:?}", deserialised);
|
|
|
|
|