Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Calling Method Within Struct Impl #2

Copy link
Copy link

Description

@esheri3
Issue body actions

Thank you for taking the time to put together this example project. This has been very useful for my introduction into calling Rust libs from Java. Can you please provide an example illustrating the changes required to allow a Java program to call a function declared within a Struct impl? For example, assume you add a new fn called "string" within the existing "Greeting" impl that accepts a param called length (u32 or whatever) and returns a const char * that acts as a String in Java. How would I call this on the Java side? Would I create a new "string" method in Greeting.java that matches the signature? Is this even possible? I'm trying to understand if I can preserve the OOP abstractions from Rust in Java or if I have to have all C-like flat function representations for Java/JNA to work.

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.