Open zotho opened 3 years ago
How much of a change would it be to change Oid
so instead of exposing a single slice of bytes, it exposed an iterator of byte slices instead? This way an Oid
could have an optional base_oid
field. Serializing and equality comparisons would use the iterator. This would be a breaking change of course, as we'd be removing the byte slice view, but it allows for trivial compile-time and runtime appending. The biggest issue I can see (beyond it being a breaking change) is that ideally you'd want to only allow appending of relative Oids to a base, but this isn't expressed in the type system, so you'd have to define some reasonable behavior for what happens if you append an absolute Oid to another one (the obvious behavior is to treat the absolute one as a relative one instead, which just expands its encoding by one byte, and means oid!(1.2.3) + oid!(4.5.6)
doesn't punish me for forgetting the rel
keyword).
Just draft to implement possibility of https://github.com/rusticata/der-parser/issues/44
But this functionality requires
#![feature(const_precise_live_drops)]