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

No mention to wrappable_struct! macro at README.md #122

Open
abinoam opened this issue Jul 20, 2020 · 3 comments
Open

No mention to wrappable_struct! macro at README.md #122

abinoam opened this issue Jul 20, 2020 · 3 comments

Comments

@abinoam
Copy link
Contributor

abinoam commented Jul 20, 2020

Is it on purpose (to keep it private so you change it at the near future (or something like that))?
Can I open a PR adding the examples of the documentation? (or at least citing its existence)

I've found wrappable_struct! by navigating through the documentation and it was exactly what I was needing for my lib. It was really confusing how it worked (and I'm still not so sure of everything).

It seems to me like it "attaches" an amount of allocated raw memory to the Ruby object instance. And it puts a Rust struct on it. And the rutie/rust wrapper is able to "decode/dereference" this memory. It doesn't show in any instance variable or something (from the Ruby side).

Could you give me hints for a better understanding of the macro?
Can we document that on the Readme so it may be clear when to use it or not to use it?

@danielpclark
Copy link
Owner

I haven't used wrappable_struct! myself, the README that speaks of this is the original project ruru https://github.com/d-unseductable/ruru#wrapping-rust-data-to-ruby-objects . I'll need to refresh myself by reading the code again if I'm going to be able to add anything more helpful.

@abinoam
Copy link
Contributor Author

abinoam commented Jul 22, 2020

I think I can put some basic documentation about at the README. In a way that harmonizes with the remaining docs. I'll open a PR and we can discuss further.

@abinoam
Copy link
Contributor Author

abinoam commented Jul 22, 2020

@danielpclark you can look at my pet project https://github.com/abinoam/matrix_rs
I think it's a really small example of how to use wrappable_struct!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants