skip_legacy_fields!() { /* proc-macro */ }Expand description
Scans a match statement for legacy fields which should be skipped.
This is used internally in LDK’s TLV serialization logic and is not expected to be used by other crates.
Wraps a match self {..} statement and scans the fields in the match patterns (in the form
ref $field_name: $field_ty) for types marked legacy, skipping those fields.
Specifically, it expects input like the following, simply dropping field3 and the
: $field_ty after each field name.
ⓘ
match self {
Enum::Variant {
ref field1: option,
ref field2: (option, explicit_type: u64),
ref field3: (legacy, u64, {}, {}), // will be skipped
..
} => expression
}