This is useful when wanting to "reserve" space such that pushes to a message at one point in the code will leave enough room for subsequent pushes later, e.g. of OPT or TSIG RRs.
Note: I initially implemented this using Option<u16> but:
MessageBuilder doesn't itself impose a 65k limit on messages so u16 is not appropriate.
Testing >= against Option<usize> felt clumsy and slightly less efficient than just comparing to usize::MAX and usize::MAX seems a safe enough hack, but if not we can use Option if that is felt to be safer/better.
This is useful when wanting to "reserve" space such that pushes to a message at one point in the code will leave enough room for subsequent pushes later, e.g. of OPT or TSIG RRs.
Note: I initially implemented this using
Option<u16>
but:MessageBuilder
doesn't itself impose a 65k limit on messages sou16
is not appropriate.Option<usize>
felt clumsy and slightly less efficient than just comparing tousize::MAX
andusize::MAX
seems a safe enough hack, but if not we can useOption
if that is felt to be safer/better.