Open john-bv opened 3 years ago
This looks like a fun issue :smile: mind if I give this a go?
go for it
should we change ProtocolEncoder
trait to
pub trait ProtocolEncoder {
fn write(&self, dst: &mut BinaryStream);
}
so that some memory copy can be avoided
Sure, I feel like this won't hurt anything. This was originally recommended by @buchwasa for raknet, which we decided against just because of how often we need to make new streams in raknet.
Issue / Question: We should utilize rust Macros.
Relevance: Rust macros would save us time when writing protocol implementation, for instance, instead of repeatedly writing implementations for ProtocolEncoder/Decoder we can utilize macros, which will be able to do this for us.
Solution:
or more advanced: