Hi, thanks for Vest.
I'd like to suggest exposing two clearly separated API modes:
- borrowed / view-based: parsed values borrow from the input buffer
- owned / copy-based: parsed values are detached copies of the input data
Right now, the zero-copy direction seems to be the default, but from the API it is not always immediately clear whether a result is:
- a borrow/view into the original input buffer, or
- an owned copy
In some cases I encountered, an owned copy is actually preferred over a borrow.
It would be helpful if Vest could make this distinction explicit, for example with two API families such as:
parse_borrowed / parse_view
parse_owned
and possibly matching generated types like:
This would make ownership semantics much clearer for users and reduce confusion around lifetimes vs copied data.
Thanks for considering it.
Hi, thanks for Vest.
I'd like to suggest exposing two clearly separated API modes:
Right now, the zero-copy direction seems to be the default, but from the API it is not always immediately clear whether a result is:
In some cases I encountered, an owned copy is actually preferred over a borrow.
It would be helpful if Vest could make this distinction explicit, for example with two API families such as:
parse_borrowed/parse_viewparse_ownedand possibly matching generated types like:
FooRef<'a>FooOwnedThis would make ownership semantics much clearer for users and reduce confusion around lifetimes vs copied data.
Thanks for considering it.