Hcs.Codec.With_codec

hcs · API reference

Parameters

module C : CODEC

Signature

val encode_body : 'a C.encoder -> 'a -> (string, codec_error) result

Encode a value to a string body.

val decode_body : 'a C.decoder -> string -> ('a, codec_error) result

Decode a string body.

val encode : 'a C.encoder -> 'a -> (Cstruct.t, codec_error) result

Encode a value to a Cstruct.t.

val decode : 'a C.decoder -> Cstruct.t -> ('a, codec_error) result

Decode a Cstruct.t.

val content_type : string

The codec content type.