This makes the bounds more clear. It's a breaking change in a few places where onlySerializeOctets was specified and not AsRef<[u8]>, altough everything that implements SerializeOctets already implements AsRef<[u8]>, because AsRef<[u8]> is a supertrait of Octets, so fixing the bounds is easy.
I also think that this conceptually simplifies the serialization: we only need to look at the octets to serialize them, that functionality does not need to differ between the types.
Marking as draft because we should first land the other PR in octseq.
In its current version, this needs to be paired with a new function in
octseq
: https://github.com/NLnetLabs/octseq/pull/57.This makes the bounds more clear. It's a breaking change in a few places where only
SerializeOctets
was specified and notAsRef<[u8]>
, altough everything that implementsSerializeOctets
already implementsAsRef<[u8]>
, becauseAsRef<[u8]>
is a supertrait ofOctets
, so fixing the bounds is easy.I also think that this conceptually simplifies the serialization: we only need to look at the octets to serialize them, that functionality does not need to differ between the types.
Marking as draft because we should first land the other PR in
octseq
.