Module volo_thrift::codec::default

source ·
Expand description

The default codec implementation. This mod contains the default implementation of codec.

We use some internal traits such as [ZeroCopyEncoder] and [ZeroCopyDecoder] to make the implementation more flexible, which is not desired to be used by others, so we don’t provide backward compatibility for them.

The main entrypoint is DefaultMakeCodec which receives [MakeZeroCopyCodec], and then creates [DefaultEncoder] and [DefaultDecoder].

DefaultMakeCodec implements MakeCodec which is used by [Server] and [Client].

We make this mod public for those who want to implement their own codec and want to reuse some of the components.

The default codec contains some private protocols, such as TTHeader, which can only be used between Volo and Kitex services (currently). If you want to use the standard thrift transport protocol, you can disable TTHeader and use Framed instead.

Currently, the default codec protocol is TTHeader<Framed<Binary>>.

Note: The default implementation of codec assumes that the transport and protocol won’t change across a connection.

Modules§

Structs§

Traits§