-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Rust bindings are not exaustive and do not exploit rust typing #2194
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
Comments
Thanks for the suggestions and this is indeed a big limitation. However, I dislike to have |
Indeed it seems a prettier way Is this way good for you ?
|
|
Also it is possible to return an |
Yes exactly, the enum this is probably the better way Which will lead to Nb: |
Concerning the any trait But yes this is not the good way to do it, but based on how it was, it was an implementation which limit the changes |
I think restricting the type of input to reg read/write functions to anything that is a "Register" makes sense, but I disagree with the enum return value and the idea of combining read/write to deal with the arm coprocessor registers. A |
Oh cool, I even overlooked that =). Thanks for your work and that makes sense indeed. |
Read them in specific functions imply that read_batch functionality is lost for such Register? |
Another question, about the dev branch, the instruction hook why to make them different from x86 and arm64 for example? Couldn't it be harmonised under a common Type (Like for the registers) |
Uh oh!
There was an error while loading. Please reload this page.
Hello
I'm a regular user of your fantastic project.
A few month ago I start used it more often and mainly in rust.
Where I find out the binding is not exploiting the full capabilities of it (mainly typing).
Ex:
Registers enum are pass to read/ write function under Into
<i32>
Moreover the reg_read wrapper don't let us read CP_REG (for exemple under arm64)
if I may suggest you a little work around using
a trait
the trait will be used in reg_read/ write
and will be implement for a CPRegisterARM64 struct
Such impl using return a ref to the heap is not a proper way
An other more beautifull path i think is the used of a traint combined with any trait
In such way which will let us develop fucntion in a more regular way
Let me know if you are interested in a way or another in such code
Have a good day
The text was updated successfully, but these errors were encountered: