Migrated from https://fxbug.dev/76635
Currently, we don't implement ByteSlice for Vec<u8> because it would be expensive to implement the split_at method. However, most uses of ByteSlice don't make use of this method. We should split ByteSlice into multiple traits and only use the trait with the split_at method where it's actually necessary. Vec can then implement the base trait but not the trait with the split_at method.
Possible names for these traits: ByteSlice and SplittableByteSlice.
Migrated from https://fxbug.dev/76635
Currently, we don't implement
ByteSliceforVec<u8>because it would be expensive to implement thesplit_atmethod. However, most uses ofByteSlicedon't make use of this method. We should splitByteSliceinto multiple traits and only use the trait with thesplit_atmethod where it's actually necessary.Veccan then implement the base trait but not the trait with thesplit_atmethod.Possible names for these traits:
ByteSliceandSplittableByteSlice.