Skip to content
This repository was archived by the owner on Aug 17, 2025. It is now read-only.
This repository was archived by the owner on Aug 17, 2025. It is now read-only.

Explore possibilities of referencing outer data types from inner module. #4

@sviezypan

Description

@sviezypan

When generating WIT files, there's a rule that all data types need to reside inside the module (except for WIT keywords like option, result, list etc)

E.g. the following would not work

struct AuctionId {
    auction_id: String,
}

#[golem_rust::create_wit_file]
mod auction_app {

    struct Auction {
        auction_id: Option<super::AuctionId>,
        name: String,
        description: String,
        starting_price: f32,
        deadline: Deadline,
    }
}

The reason is that macro create_wit_file can't really see tokens outside of module that it is annotating. Is there a possibility to work around that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions