Skip to content

Commit

Permalink
Merge pull request #8661 from ProofOfKeags/feature/record-producer-axiom
Browse files Browse the repository at this point in the history
tlv: add axiomatic RecordProducer implementation for Record
  • Loading branch information
guggero committed Apr 22, 2024
2 parents d4c1937 + 6257df3 commit a201d5e
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions tlv/record.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ type Record struct {
decoder Decoder
}

// Record (the function) is the trivial implementation of RecordProducer for
// Record (the type). This makes it seamless to mix primitive and dynamic
// records together in the same collections.
//
// NOTE: Part of the RecordProducer interface.
func (f *Record) Record() Record {
return *f
}

// Size returns the size of the Record's value. If no static size is known, the
// dynamic size will be evaluated.
func (f *Record) Size() uint64 {
Expand Down

0 comments on commit a201d5e

Please sign in to comment.