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

Add pagination members to struct via macro #104

Merged
merged 7 commits into from
Aug 22, 2024
Merged

Conversation

kevin-pease
Copy link
Contributor

@kevin-pease kevin-pease commented Aug 20, 2024

✨ What kind of change does this PR introduce? (Bug fix, feature, docs update...)

Fixes #81, #82 and #66.

Changes the derive macro for pagination functionality to an attribute macro. In addition to injecting the 3 methods for pagination, the macro now also injects the 3 required fields. Updates all implementations of this macro.

Since a Paginatable trait is no longer necessary and undesirable as per issue #81, this is also removed.

Adds documentation and comments.

Note: since the macro is named specifically stellar_rust_sdk_derive but is now an attribute macro, we should probably change the name accordingly.

📝 Links to relevant issues/docs

https://users.rust-lang.org/t/solved-derive-and-proc-macro-add-field-to-an-existing-struct/52307/4
https://doc.rust-lang.org/reference/procedural-macros.html#attribute-macros

🤔 Checklist before submitting

  • All projects build
  • Follows style guide lines
  • Relevant documentation was updated
  • Rebased onto current main

Copy link
Collaborator

@tluijken tluijken left a comment

Choose a reason for hiding this comment

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

Wauw, wat een heerlijke PR! Super gedaan 🙌

@@ -38,27 +36,15 @@ use stellar_rust_sdk_derive::Pagination;
///
/// ```
///
#[derive(Default, Pagination)]
#[pagination]
Copy link
Collaborator

Choose a reason for hiding this comment

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

❤️ wauw!

@kevin-pease kevin-pease force-pushed the 82-pagination-members branch from 705d5d7 to 9dd913f Compare August 22, 2024 13:21
@kevin-pease kevin-pease force-pushed the 82-pagination-members branch from 9dd913f to 9e3486e Compare August 22, 2024 13:37
@tluijken tluijken self-requested a review August 22, 2024 14:21
@tluijken tluijken merged commit b886c76 into develop Aug 22, 2024
2 checks passed
@tluijken tluijken deleted the 82-pagination-members branch August 22, 2024 14:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants