@@ -281,6 +281,12 @@ macro_rules! _check_decoded_tlv_order {
281281 ( $last_seen_type: expr, $typ: expr, $type: expr, $field: ident, option) => { {
282282 // no-op
283283 } } ;
284+ ( $last_seen_type: expr, $typ: expr, $type: expr, $field: ident, ( option, explicit_type: $fieldty: ty) ) => { {
285+ // no-op
286+ } } ;
287+ ( $last_seen_type: expr, $typ: expr, $type: expr, $field: ident, ( required, explicit_type: $fieldty: ty) ) => { {
288+ // no-op
289+ } } ;
284290 ( $last_seen_type: expr, $typ: expr, $type: expr, $field: ident, required_vec) => { {
285291 $crate:: _check_decoded_tlv_order!( $last_seen_type, $typ, $type, $field, required) ;
286292 } } ;
@@ -332,6 +338,12 @@ macro_rules! _check_missing_tlv {
332338 ( $last_seen_type: expr, $type: expr, $field: ident, option) => { {
333339 // no-op
334340 } } ;
341+ ( $last_seen_type: expr, $type: expr, $field: ident, ( option, explicit_type: $fieldty: ty) ) => { {
342+ // no-op
343+ } } ;
344+ ( $last_seen_type: expr, $type: expr, $field: ident, ( required, explicit_type: $fieldty: ty) ) => { {
345+ // no-op
346+ } } ;
335347 ( $last_seen_type: expr, $type: expr, $field: ident, optional_vec) => { {
336348 // no-op
337349 } } ;
@@ -372,6 +384,12 @@ macro_rules! _decode_tlv {
372384 ( $outer_reader: expr, $reader: expr, $field: ident, option) => { {
373385 $field = Some ( $crate:: util:: ser:: Readable :: read( & mut $reader) ?) ;
374386 } } ;
387+ ( $outer_reader: expr, $reader: expr, $field: ident, ( option, explicit_type: $fieldty: ty) ) => { {
388+ $field = Some ( $crate:: util:: ser:: Readable :: read( & mut $reader) ?) ;
389+ } } ;
390+ ( $outer_reader: expr, $reader: expr, $field: ident, ( required, explicit_type: $fieldty: ty) ) => { {
391+ $field = Some ( $crate:: util:: ser:: Readable :: read( & mut $reader) ?) ;
392+ } } ;
375393 ( $outer_reader: expr, $reader: expr, $field: ident, optional_vec) => { {
376394 let f: $crate:: util:: ser:: WithoutLength <Vec <_>> = $crate:: util:: ser:: Readable :: read( & mut $reader) ?;
377395 $field = Some ( f. 0 ) ;
@@ -795,6 +813,12 @@ macro_rules! _init_tlv_field_var {
795813 ( $field: ident, optional_vec) => {
796814 let mut $field = Some ( Vec :: new( ) ) ;
797815 } ;
816+ ( $field: ident, ( option, explicit_type: $fieldty: ty) ) => {
817+ let mut $field: Option <$fieldty> = None ;
818+ } ;
819+ ( $field: ident, ( required, explicit_type: $fieldty: ty) ) => {
820+ let mut $field = $crate:: util:: ser:: RequiredWrapper :: <$fieldty>( None ) ;
821+ } ;
798822 ( $field: ident, ( option, encoding: ( $fieldty: ty, $encoding: ident) ) ) => {
799823 $crate:: _init_tlv_field_var!( $field, option) ;
800824 } ;
0 commit comments