36
36
// - `impl_into_encodable_field_for_seq!`: Implements conversions to `EncodableField` for a
37
37
// sequence, adapting the sequence for inclusion in serialized structures.
38
38
//
39
- // ## Notes on Serialization
40
- //
41
- // Types are designed to interoperate with the `serde-sv2` framework, using lifetimes
42
- // (`'a`) for compatibility with external lifetimes and ensuring the types can be converted into
43
- // various serialized forms with or without `serde` support.
44
- //
45
39
// ## Build Options
46
40
//
47
41
// - `prop_test`: Enables property-based testing compatibility by implementing `TryFrom` for `Vec`
@@ -60,7 +54,7 @@ use crate::{
60
54
} ;
61
55
use core:: marker:: PhantomData ;
62
56
63
- // TODO add test for that and implement it also with serde!!!!
57
+ // TODO add test for that
64
58
impl < ' a , const SIZE : usize , const HEADERSIZE : usize , const MAXSIZE : usize >
65
59
Seq0255 < ' a , super :: inner:: Inner < ' a , false , SIZE , HEADERSIZE , MAXSIZE > >
66
60
{
@@ -74,7 +68,7 @@ impl<'a, const SIZE: usize, const HEADERSIZE: usize, const MAXSIZE: usize>
74
68
}
75
69
}
76
70
77
- // TODO add test for that and implement it also with serde!!!!
71
+ // TODO add test for that
78
72
impl < ' a , const SIZE : usize > Seq0255 < ' a , super :: inner:: Inner < ' a , true , SIZE , 0 , 0 > > {
79
73
/// Converts the inner types to owned vector, and collects.
80
74
pub fn to_vec ( & self ) -> Vec < Vec < u8 > > {
@@ -86,7 +80,7 @@ impl<'a, const SIZE: usize> Seq0255<'a, super::inner::Inner<'a, true, SIZE, 0, 0
86
80
self . 0 . iter ( ) . map ( |x| x. inner_as_ref ( ) ) . collect ( )
87
81
}
88
82
}
89
- // TODO add test for that and implement it also with serde!!!!
83
+ // TODO add test for that
90
84
impl < ' a , const SIZE : usize , const HEADERSIZE : usize , const MAXSIZE : usize >
91
85
Seq064K < ' a , super :: inner:: Inner < ' a , false , SIZE , HEADERSIZE , MAXSIZE > >
92
86
{
@@ -101,7 +95,7 @@ impl<'a, const SIZE: usize, const HEADERSIZE: usize, const MAXSIZE: usize>
101
95
}
102
96
}
103
97
104
- // TODO add test for that and implement it also with serde!!!!
98
+ // TODO add test for that
105
99
impl < ' a , const SIZE : usize > Seq064K < ' a , super :: inner:: Inner < ' a , true , SIZE , 0 , 0 > > {
106
100
/// Converts the inner types to owned vector, and collects.
107
101
pub fn to_vec ( & self ) -> Vec < Vec < u8 > > {
@@ -118,8 +112,7 @@ impl<'a, const SIZE: usize> Seq064K<'a, super::inner::Inner<'a, true, SIZE, 0, 0
118
112
use std:: io:: Read ;
119
113
120
114
/// [`Seq0255`] represents a sequence with a maximum length of 255 elements.
121
- /// This structure uses a generic type `T` and a lifetime parameter `'a`
122
- /// to ensure compatibility with `serde-sv2`.
115
+ /// This structure uses a generic type `T` and a lifetime parameter `'a`.
123
116
#[ repr( C ) ]
124
117
#[ derive( Debug , Clone , Eq , PartialEq ) ]
125
118
pub struct Seq0255 < ' a , T > ( pub Vec < T > , PhantomData < & ' a T > ) ;
@@ -163,8 +156,7 @@ impl<'a, T: GetSize> GetSize for Seq0255<'a, T> {
163
156
}
164
157
165
158
/// [`Seq064K`] represents a sequence with a maximum length of 65535 elements.
166
- /// This structure uses a generic type `T` and a lifetime parameter `'a`
167
- /// to ensure compatibility with `serde-sv2`.
159
+ /// This structure uses a generic type `T` and a lifetime parameter `'a`.
168
160
#[ derive( Debug , Clone , Eq , PartialEq ) ]
169
161
pub struct Seq064K < ' a , T > ( pub ( crate ) Vec < T > , PhantomData < & ' a T > ) ;
170
162
@@ -455,12 +447,12 @@ impl<'a, const ISFIXED: bool, const SIZE: usize, const HEADERSIZE: usize, const
455
447
}
456
448
}
457
449
458
- /// The liftime is here only for type compatibility with serde-sv2
450
+ /// The lifetime 'a is defined.
459
451
#[ repr( C ) ]
460
452
#[ derive( Debug , Clone , Eq , PartialEq ) ]
461
453
pub struct Sv2Option < ' a , T > ( pub Vec < T > , PhantomData < & ' a T > ) ;
462
454
463
- // TODO add test for that and implement it also with serde!!!!
455
+ // TODO add test for that
464
456
impl < ' a , const SIZE : usize > Sv2Option < ' a , super :: inner:: Inner < ' a , true , SIZE , 0 , 0 > > {
465
457
/// Gets the owned first element of the sequence, if present
466
458
pub fn to_option ( & self ) -> Option < Vec < u8 > > {
0 commit comments