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

allow export derive macro to name effect #221

Merged
merged 3 commits into from
May 14, 2024

Conversation

StuartHarris
Copy link
Member

Modifies the Export derive macro so that it respects the name set by the effect attribute for the Effect derive macro. This allows the following to work, creating MyEffectFfi to match the MyEffect type.

#[cfg_attr(feature = "typegen", derive(crux_core::macros::Export))]
#[derive(crux_core::macros::Effect)]
#[effect(name = "MyEffect", app = "NoteEditor")]
pub struct Capabilities {
    timer: Timer<Event>,
    render: Render<Event>,
    pub_sub: PubSub<Event>,
    key_value: KeyValue<Event>,
}

Copy link
Member

@charypar charypar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Huh, I would've sworn we already had this. 🤔

@charypar
Copy link
Member

charypar commented Apr 2, 2024

Should we add a test using this as well?

@StuartHarris StuartHarris merged commit d2319f5 into master May 14, 2024
9 checks passed
@StuartHarris StuartHarris deleted the export-macro-effect-name branch May 14, 2024 11:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants