Skip to content

Attributes for Param, SelfParam, and StructField types #521

@ambiguousname

Description

@ambiguousname

Per rust-lang/rust#60406 and https://doc.rust-lang.org/reference/attributes.html, attributes can be positioned in struct fields or parameters positions. Diplomat currently does not have an attrs field for the Param, ParamSelf, or StructField types.

This is something that would be especially nice to have for #500.

So for instance, you'd be able to write something like

struct SomeStruct {
  #[diplomat::attr(not(dart), disable)]
  pub dart_specific_feature,
}

Or

fn foo(
  #[diplomat::attr(kotlin, rename="someNewNameHere")]
  in : i32
) {}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions