Connection between tonic::codec and tokio_util::codec? #761
Unanswered
themaxdavitt
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I see that
tokio-util
(specifically the "codec" feature) is a dependency oftonic
, but runninggrep -R tokio_util .
in the root of the repository yielded nothing.tokio-util
'sDecoder
andEncoder
traits are very similar totonic
'sDecoder
andEncoder
, mainly differing intokio-util
'sEncoder
using a type parameter versus an associated type andtonic
's traits preferring mutable references toDecodeBuf
s andEncodeBuf
s overBytesMut
s.Is there a specific reason why the codec design pattern was reimplemented here rather than reused? What benefit do
DecodeBuf
andEncodeBuf
provide overBytesMut
? Sorry if I would've been able to answer these myself by working with the code more, I just found this crate recently. Thanks in advance!Beta Was this translation helpful? Give feedback.
All reactions