Skip to content

feat(plugin-api): Better method chaining (Rust) - #3045

Merged
Snowiiii merged 4 commits into
Pumpkin-MC:masterfrom
QuantumSegfault:better-method-chaining
Aug 25, 2026
Merged

feat(plugin-api): Better method chaining (Rust)#3045
Snowiiii merged 4 commits into
Pumpkin-MC:masterfrom
QuantumSegfault:better-method-chaining

Conversation

@QuantumSegfault

@QuantumSegfault QuantumSegfault commented Aug 25, 2026

Copy link
Copy Markdown
Collaborator

Description

Updates wit-bindgen for the pumpkin-plugin-api (Rust bindings) to 0.61 to take advantage of bytecodealliance/wit-bindgen#1602

The configuration has been updated so that only some resources enable method chaining, and that said methods/resources use owning method chaining, rather than borrowing (they return Self rather than &Self).

Testing

Testing was done to ensure bindings still compile, and that a Rust plugin using commands and text components can compile successfully (after modification).

Some of the methods in the crate wrap around generated methods from the WIT, so they show evidence that the transition to owning borrowing is working.

wit-bindgen itself has tests for whether the chaining functions correctly.

@QuantumSegfault

Copy link
Copy Markdown
Collaborator Author

CI fails cause of a new issue introduced into 0.61. I have a patch here: bytecodealliance/wit-bindgen#1697

In the meantime, I've but in a stub for cabi_realloc to satisfy the linker (the symbol is otherwise never called).

@Snowiiii

Copy link
Copy Markdown
Member

LGTM, Thank you @QuantumSegfault :D

@Snowiiii
Snowiiii merged commit 67eaa91 into Pumpkin-MC:master Aug 25, 2026
16 checks passed
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.

2 participants