Our little homegrown arena library, called pool, is a little like id-arena or similar, but with special stuff we need for our "zero-copy" use case.
Previously, it was implemented as special traits that extend plain old Rust types like &[T] and Vec<T>. This was convenient in some ways but got confusing and prevented some fancier convenience features. I've now wrapped these in newtypes Store and Pool that let us more carefully control the interface to the arenas. This should be less error-prone in the long run. As an added bonus, it makes it easier to access pools with subscripting: for example, gfa.segs[id] works where id has type Id<Segment>.
Our little homegrown arena library, called
pool
, is a little like id-arena or similar, but with special stuff we need for our "zero-copy" use case.Previously, it was implemented as special traits that extend plain old Rust types like
&[T]
andVec<T>
. This was convenient in some ways but got confusing and prevented some fancier convenience features. I've now wrapped these in newtypesStore
andPool
that let us more carefully control the interface to the arenas. This should be less error-prone in the long run. As an added bonus, it makes it easier to access pools with subscripting: for example,gfa.segs[id]
works whereid
has typeId<Segment>
.