@@ -874,6 +874,8 @@ macro_rules! tlv_record_ref_type {
874
874
( $type: ty) => { & ' a $type } ;
875
875
}
876
876
877
+ #[ doc( hidden) ]
878
+ #[ macro_export]
877
879
macro_rules! _impl_writeable_tlv_based_enum_common {
878
880
( $st: ident, $( ( $variant_id: expr, $variant_name: ident) =>
879
881
{ $( ( $type: expr, $field: ident, $fieldty: tt) ) ,* $( , ) * }
@@ -885,7 +887,7 @@ macro_rules! _impl_writeable_tlv_based_enum_common {
885
887
$( $st:: $variant_name { $( ref $field) ,* } => {
886
888
let id: u8 = $variant_id;
887
889
id. write( writer) ?;
888
- write_tlv_fields!( writer, {
890
+ $crate :: write_tlv_fields!( writer, {
889
891
$( ( $type, * $field, $fieldty) ) ,*
890
892
} ) ;
891
893
} ) ,*
@@ -923,7 +925,7 @@ macro_rules! impl_writeable_tlv_based_enum {
923
925
{ $( ( $type: expr, $field: ident, $fieldty: tt) ) ,* $( , ) * }
924
926
) ,* $( , ) * ;
925
927
$( ( $tuple_variant_id: expr, $tuple_variant_name: ident) ) ,* $( , ) * ) => {
926
- _impl_writeable_tlv_based_enum_common!( $st,
928
+ $crate :: _impl_writeable_tlv_based_enum_common!( $st,
927
929
$( ( $variant_id, $variant_name) => { $( ( $type, $field, $fieldty) ) ,* } ) ,* ;
928
930
$( ( $tuple_variant_id, $tuple_variant_name) ) ,* ) ;
929
931
@@ -935,12 +937,12 @@ macro_rules! impl_writeable_tlv_based_enum {
935
937
// Because read_tlv_fields creates a labeled loop, we cannot call it twice
936
938
// in the same function body. Instead, we define a closure and call it.
937
939
let f = || {
938
- _init_and_read_tlv_fields!( reader, {
940
+ $crate :: _init_and_read_tlv_fields!( reader, {
939
941
$( ( $type, $field, $fieldty) ) ,*
940
942
} ) ;
941
943
Ok ( $st:: $variant_name {
942
944
$(
943
- $field: _init_tlv_based_struct_field!( $field, $fieldty)
945
+ $field: $crate :: _init_tlv_based_struct_field!( $field, $fieldty)
944
946
) ,*
945
947
} )
946
948
} ;
@@ -977,7 +979,7 @@ macro_rules! impl_writeable_tlv_based_enum_upgradable {
977
979
) ,* $( , ) *
978
980
$( ;
979
981
$( ( $tuple_variant_id: expr, $tuple_variant_name: ident) ) ,* $( , ) * ) * ) => {
980
- _impl_writeable_tlv_based_enum_common!( $st,
982
+ $crate :: _impl_writeable_tlv_based_enum_common!( $st,
981
983
$( ( $variant_id, $variant_name) => { $( ( $type, $field, $fieldty) ) ,* } ) ,* ;
982
984
$( $( ( $tuple_variant_id, $tuple_variant_name) ) ,* ) * ) ;
983
985
@@ -989,12 +991,12 @@ macro_rules! impl_writeable_tlv_based_enum_upgradable {
989
991
// Because read_tlv_fields creates a labeled loop, we cannot call it twice
990
992
// in the same function body. Instead, we define a closure and call it.
991
993
let f = || {
992
- _init_and_read_tlv_fields!( reader, {
994
+ $crate :: _init_and_read_tlv_fields!( reader, {
993
995
$( ( $type, $field, $fieldty) ) ,*
994
996
} ) ;
995
997
Ok ( Some ( $st:: $variant_name {
996
998
$(
997
- $field: _init_tlv_based_struct_field!( $field, $fieldty)
999
+ $field: $crate :: _init_tlv_based_struct_field!( $field, $fieldty)
998
1000
) ,*
999
1001
} ) )
1000
1002
} ;
0 commit comments