Skip to content

feat(api)!: replace HasVec with generic HasItems trait#5

Merged
hdoo42 merged 1 commit into
masterfrom
HasItemImpl
Oct 23, 2025
Merged

feat(api)!: replace HasVec with generic HasItems trait#5
hdoo42 merged 1 commit into
masterfrom
HasItemImpl

Conversation

@hdoo42

@hdoo42 hdoo42 commented Oct 23, 2025

Copy link
Copy Markdown
Owner

Introduces a new HasItems trait and procedural macro to provide a generic interface for iterating over collections within API response types. This replaces the more limited HasVec trait.

The new HasItems derive macro supports both Vec<T> and HashMap<K, V> fields, with configurable modes for iterating over values or entries. This provides a more flexible and powerful way to handle collection-based API responses.

All existing API response types have been updated to use the new HasItems trait. The scroller utility has also been updated to work with the new abstraction.

BREAKING CHANGE: The HasVec trait and HasVector derive macro have been removed. Code that previously used get_vec() or take_vec() must be updated to use iter_items() or into_items() from the new HasItems trait.

Introduces a new `HasItems` trait and procedural macro to provide a generic interface for iterating over collections within API response types. This replaces the more limited `HasVec` trait.

The new `HasItems` derive macro supports both `Vec<T>` and `HashMap<K, V>` fields, with configurable modes for iterating over values or entries. This provides a more flexible and powerful way to handle collection-based API responses.

All existing API response types have been updated to use the new `HasItems` trait. The `scroller` utility has also been updated to work with the new abstraction.

BREAKING CHANGE: The `HasVec` trait and `HasVector` derive macro have been removed. Code that previously used `get_vec()` or `take_vec()` must be updated to use `iter_items()` or `into_items()` from the new `HasItems` trait.
@hdoo42 hdoo42 merged commit 85e08c5 into master Oct 23, 2025
1 check passed
@hdoo42 hdoo42 deleted the HasItemImpl branch October 23, 2025 08:50
hdoo42 added a commit that referenced this pull request Oct 23, 2025
feat(api)!: replace HasVec with generic HasItems trait

bump up version to 0.2.0
hdoo42 added a commit that referenced this pull request Oct 24, 2025
This reverts commit 85e08c5, reversing
changes made to e30a86e.
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