Skip to content

Support for adding attributes to Rust types and functions #81

Open

Description

@mrmelon54

Just like adding Java interfaces to Rust types, would it be possible to add support for class attributes?

Activity

  1. IntegralPilot commented on Oct 15, 2026

    @IntegralPilot
    Owner

    Yes, I just did it now, thank you for the great idea! Sorry for the delay in responding, I was busy with a seperate project.

    You can do it like this:

    #[jvm::annotation("java.lang.Deprecated", since = "1.0")]
    pub struct OldWidget {
        pub value: i32,
    }

    Let me know if you like it or have any feedback! :)

  2. mrmelon54 commented on Oct 17, 2026

    @mrmelon54
    Author

    Class attributes seem to work fine.

    Would it be possible to get method and function attributes too?

  3. changed the title [-]Support for adding class attributes to Rust types[/-] [+]Support for adding attributes to Rust types and functions[/+] on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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