tokio-rs / bytes

Utilities for working with bytes
MIT License
1.87k stars 278 forks source link

Stabilize vtable api #558

Closed ipoupaille closed 1 year ago

ipoupaille commented 2 years ago

The use case is for example use Bytes create with memory from mmap. A file is mapped in memory before construct of the first bytes, and unmapped when the last is dropped.

NobodyXu commented 1 year ago

IMHO marking the all fields of Vtable struct as pub might be a compatibility issue in the future. What if we want to add a new optional function to Vtable?

I think it's better to have a VtableBuilder to build Vtable where new optional functions can be skipped.