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
46
47
use ;
use ;
use Cow;
/// Serializes a given value into a byte array.
///
/// # Arguments
/// * `value` - A reference to the value to serialize.
///
/// # Returns
/// A `Cow<[u8]>` representing the serialized data.
///
/// # Panics
/// Panics if serialization fails.
/// Deserializes a value from a byte array.
///
/// # Arguments
/// * `bytes` - A `Cow<'_, [u8]>` representing the bytes to deserialize from.
///
/// # Returns
/// The deserialized value of type `T`.
///
/// # Panics
/// Panics if deserialization fails.
/// Provides a default deserialization value for boolean fields, defaulting to `true`.
///
/// This function is a workaround for handling default values when deserializing with Serde,
/// particularly useful in scenarios where boolean fields need to default to `true` instead
/// of the usual `false` when not explicitly provided in the input.
///
/// # Returns
/// Returns `Some(true)`, indicating the default value to use.