You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a scenario where source bytes for my custom SpanContents are potentially dynamically generated by each call to read_span on my source code, returning an Arc<str> (which is then stored in my SpanContents), and it would be very helpful to be able to return an opaque, possibly-owned value instead of &'a [u8] (something along the lines of impl AsRef<[u8]> + 'a)
edit 1 : impl AsRef<[u8]> + 'a breaks object safety (duh), looking for an alternative
The text was updated successfully, but these errors were encountered:
The-Minecraft-Scientist
changed the title
Allow returning possibly-owned data from SpanContents::data
returning owned data from SpanContents::dataNov 22, 2024
I have a scenario where source bytes for my custom SpanContents are potentially dynamically generated by each call to
read_span
on my source code, returning anArc<str>
(which is then stored in my SpanContents), and it would be very helpful to be able to return an opaque, possibly-owned value instead of&'a [u8]
(something along the lines ofimpl AsRef<[u8]> + 'a
)edit 1 :
impl AsRef<[u8]> + 'a
breaks object safety (duh), looking for an alternativeThe text was updated successfully, but these errors were encountered: