[Feature] Handle zenoh keyexpr with std::string_view
rather than const std::string &
#325
Labels
backlog
Long-term improvement or addition
The zenoh key expression is not null-terminated. That's why we need to attain the pointer with its length while printing the string in zenoh-c.
Currently, we use
const std::string &
to process the passing keyexpr after conversion. This forces us to copy the context by creating astd::string
. The most efficient way to borrow and read the zenoh keyexpr isz_keyexpr_as_view_string
to read thez_view_string_t
from a loaned keyexpr.std::string_view(z_string_data, z_string_len)
.NOTE
We need to mind the lifetime of owned key expr. Ideally, all the rmw_zenoh entities should own the data rather than a reference to somewhere.
The text was updated successfully, but these errors were encountered: