Closed frankmcsherry closed 9 months ago
Oh oops, it also adds a SliceContainer
which shows off the new BatchContainer
by having an Item = [B]
but accepting Vec<B>
in push
and copy_slice
, and storing only one Vec<B>
and a whole bunch of offsets into it (as many as you introduce, plus one).
This PR moves
BatchContainer
andOrdOffset
out of thelayers
module which is specific to Trie implementations, and in to theimplementations
module, which seems more appropriate.It also experiments a bit with the
BatchContainer
trait, allowingItem
to be unsized, and supportingpush
andcopy_slice
only whenT: ToOwned
. This is .. unfortunately a restriction rather than a pure generalization; to implementToOwned
you have to be able to clone yourself, even though we don't need this.Up for discussion, but I think based on the vibes around containers, and their non-ownership-providing nature, this might be ok.
cc: @antiguru