Open dignifiedquire opened 2 weeks ago
We'll have a chance to look at this issue in more detail later, but briefly off the top of my head: check out how we handle this in 0.8. The ByteSlice
trait has been split up, and we've made the resulting traits unsealed so that external crates can implement them.
and we've made the resulting traits unsealed so that external crates can implement them.
Unfortunately that doesn't help, as the orphan rule prevents us from implementing the trait for an external type :/
It may be possible to workaround this via a newtype to experiment with this as a solution.
A lot of my networking code uses
bytes
to handle efficient storing of incoming and outgoing packets. I would like to transition more of that code to usezerocopy
, but for that some integration would be required.The following example is for the parsing side of what I would like to do, but this fails as
ByteSlice
is not implemented forbytes::Bytes
orbytes::BytesMut
.I can't implement this in my own crate, as both the type and the trait are in 3rd party crates.