Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More typed interface for RingBuffer (and others) #350

Open
danielocfb opened this issue Jan 31, 2023 · 3 comments
Open

More typed interface for RingBuffer (and others) #350

danielocfb opened this issue Jan 31, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@danielocfb
Copy link
Collaborator

danielocfb commented Jan 31, 2023

RingBuffer (and Map) objects are not the easiest to use. One request we had come up more than once now is that it may prove beneficial to user acceptance to have the ring buffer take care of some of the nitty gritty byte copying and decoding itself, instead of forcing users to worry about it.

@danielocfb danielocfb added the enhancement New feature or request label Jan 31, 2023
@anakryiko
Copy link
Member

This might make sense as some sort of "add-on" on top of RingBuffer, but in most general case RingBuffer is just sending raw bytes, and each message can be of different size and type.

@hodgesds
Copy link
Contributor

hodgesds commented Feb 1, 2023

I had a poor attempt at generating serde in this branch for skeleton generated objects. There were some type conversions that I don't remember off the top of my head that I ran into. However, what I found worked somewhat well was using plain to handle skel generated types that were being passed over the ring buffer (example).

@hodgesds
Copy link
Contributor

hodgesds commented Feb 1, 2023

I think I remember now, serde doesn't work well with #[repr(C)] structs which libbpf-rs generates. This is a somewhat similar issue.

@danielocfb danielocfb changed the title More typed interface for RingBuffer More typed interface for RingBuffer (and others) Feb 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants