-
Notifications
You must be signed in to change notification settings - Fork 50
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
Avoid exposing Pointer and PointersIter from ndk #122
Conversation
982b2db
to
6056239
Compare
I suppose I'm not super keen on putting backend specific details into the common Although it'll be more verbose overall I can imagine at some point that we could keep the Essentially, the problem right now is that since we don't have full coverage unit tests for the input API then it's very possible to break public api compatibility atm. Maybe as a starting point for the Pointer type we could:
#[derive(Debug)]
pub struct Pointer<'a> {
inner: PointerImpl<'a>,
}
impl<'a> Pointer<a'> {
#[inline]
pub fn pointer_index(&self) -> usize {
self.inner.pointer_index()
}
...
} whereby we're forced to keep the For reference there is a vague idea that at some point it could be good to try and implement our own Alternatively though I think it'd be OK if we just introduce a |
99f0ad5
to
5560a71
Compare
5560a71
to
9930b9b
Compare
I tried the I think it looks ok, and it scales nicely to a possible third Regarding a possible future third backend - do you envision that it (if it works out nicely) could be the best way forward in the long run, perhaps replacing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cool, thanks for taking a look at this!
I see you reduced the boilerplate needed for some of the axis_value
convenience getters which makes sense.
This all looks good to me.
Having a common place to now put some docs for the API should be good too.
Hypothetically though, I could imagine that a Since adding the |
See #121, which this PR replaces.
I did this as a quick sketch, can check it more carefully tomorrow, but wanted to check for your thoughts on this approach.
What do you think having a single
impl
, with#[cfg(feature = "game/native-activity")]
checks inside the method, instead of mirroring twoimpl
:s? In this case I personally think it reads better, and guarantees exact equality in the public API and its documentation, but I can change it if desired!