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

add Rust(std::option::Option) <-> Java(X) mapping #11

Closed
Dushistov opened this issue Aug 2, 2017 · 12 comments · Fixed by #243
Closed

add Rust(std::option::Option) <-> Java(X) mapping #11

Dushistov opened this issue Aug 2, 2017 · 12 comments · Fixed by #243
Assignees
Labels
enhancement Java/JNI Case specific only for Java/JNI interface generation
Milestone

Comments

@Dushistov
Copy link
Owner

Option for Android is hard, so should be setting to generate our own option.

@Dushistov Dushistov added this to the 0.1.0 milestone Aug 2, 2017
@Dushistov Dushistov removed this from the 0.1.0 milestone Feb 15, 2018
@Dushistov Dushistov self-assigned this Jul 30, 2018
@Dushistov Dushistov added this to the 0.1.6 milestone Jul 30, 2018
@VMatrix1900
Copy link

Has this feature been implemented? Can we close this issue?

@Dushistov
Copy link
Owner Author

@VMatrix1900

Is is partly implemented, now only Option<f64 | i64> handled,
I plan to have implementation for at least Option<bool | i8 | i16 | i32> plus Option<ForeignClass> before closing this issue.

@Dushistov Dushistov removed this from the 0.1.6 milestone Feb 24, 2019
@VMatrix1900
Copy link

@Dushistov When will this implemented? In 0.2.1? Option<ForeignClass> is very nice to have.

@Dushistov
Copy link
Owner Author

@VMatrix1900

Ok, I will include implementation into the next release.

@coltfred
Copy link
Contributor

@Dushistov Have you had a chance to start on this at all? I also need this support and was trying to figure out if I should try and write it in a mappings file or not. (Disclaimer: I don't actually know what I'm doing)

@Dushistov
Copy link
Owner Author

Dushistov commented Mar 2, 2019

@coltfred

Have you had a chance to start on this at all?

As new mantainer, now I am busy with new release of https://github.com/Dushistov/bluetooth-serial-port .
When it will be done, and nobody will implement this feature, I am going to start work on it.

For this feature I imagine to implement something like this:

static_method f(x: Option<Foo>) -> Option<Boo>;

to

Optional<T> f(@Nullable Foo x);

@coltfred
Copy link
Contributor

coltfred commented Mar 3, 2019 via email

@Dushistov
Copy link
Owner Author

Dushistov commented Mar 14, 2019

Missed things:

  1. Support of Option<i32> as input/output
  2. i8,i16,f32 as input
  3. Option<&str> as input
  4. Option as input
  5. Check right usage of Nullable / NotNull attributes

@coltfred
Copy link
Contributor

coltfred commented Mar 15, 2019

@Dushistov It seems we also don't have Option<String> or Option<&str> as a return type. Did you miss that in your above comment or am I missing something?

@Dushistov
Copy link
Owner Author

@coltfred

It seems we also don't have Option or Option<&str> as a return type. Did you miss that in your > above comment or am I missing something?

I am today did some java job, and missed Option<&str> as input argument,
that's why I included it into list. If you need also Option<String>, Option<&str> we
can also include them into list.

@coltfred
Copy link
Contributor

coltfred commented Mar 16, 2019 via email

@Dushistov Dushistov added the Java/JNI Case specific only for Java/JNI interface generation label Apr 23, 2019
@Dushistov
Copy link
Owner Author

Dushistov commented Apr 27, 2019

Missed things:

  1. Support of Option<i32> as input/output
  2. i8,i16,f32 as input
  3. Option<&str> as input
  4. Option<&T> as input
  5. Option<ForeignEnum> as input and output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Java/JNI Case specific only for Java/JNI interface generation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants