Skip to content

Conversation

joshua-spacetime
Copy link
Collaborator

@joshua-spacetime joshua-spacetime commented Oct 10, 2025

Description of Changes

Adds the #[view] procedural macro and module describers for views.

#[view(public)]
fn player(ctx: &ViewContext) -> Vec<Player> {
    ctx.db.player().identity().find(ctx.sender).into_iter().collect()
}

#[view(public, anonymous)]
fn player(ctx: &AnonymousViewContext, level: u32) -> Vec<Player> {
    ctx.db.player().level().filter(level).collect()
}

TODO:

  1. Support for T and Option<T> return types
  2. System table updates and module validation on publish

API and ABI breaking changes

None

Expected complexity level and risk

2

Testing

  • Negative compile tests
  • Negative publish (module validation) tests
  • Test system tables are updated accurately

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.

1 participant