1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
//! Utilities for encoding and decoding task arguments and results
//!
//! # Overview
//!
//! The `Codec` trait allows for converting values
//! between a type `T` and a more compact or transport-friendly representation.
//! This is particularly useful for serializing/deserializing, compressing/expanding,
//! or otherwise encoding/decoding values in a custom format.
/// A trait for converting values between a type `T` and a more compact or
/// transport-friendly representation for a `Backend`. Examples include json
/// and bytes.
///
/// This is useful when you need to serialize/deserialize, compress/expand,
/// or otherwise encode/decode values in a custom format.
///
/// By default, a backend doesn't care about the specific type implementing [`Codec`]
/// but rather the [`Codec::Compact`] type. This means if it can accept bytes, you
/// can use familiar crates such as bincode and rkyv
///
/// # Type Parameters
/// - `T`: The type of value being encoded/decoded.