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

Refactor slave grouping to be more ergonomic #45

Merged
merged 18 commits into from
May 1, 2023
Merged

Refactor slave grouping to be more ergonomic #45

merged 18 commits into from
May 1, 2023

Conversation

jamwaffles
Copy link
Collaborator

@jamwaffles jamwaffles commented May 1, 2023

  • The SlaveGroupContainer trait is not longer required to be implemented and is removed.
  • The grouping closure now requires a &dyn SlaveGroupHandle to be returned. This is a sealed trait only implemented for SlaveGroups and allows some internal refactors by erasing the const generics from SlaveGroup.
  • Internal: SlaveStorage is removed. Slave devices for a group are now simply stored in a heapless::Vec.
  • The const generic on Client::init now defines the max number of groups, not the max number of slave devices, and should match the number of unique groups passed in (struct fields, array/tuple items, etc)

Closes #35 - SlaveGroupContainer is gone now.

@jamwaffles jamwaffles merged commit fbb961a into master May 1, 2023
@jamwaffles jamwaffles deleted the stuff-2 branch May 1, 2023 13:39
jimy-byerley pushed a commit to jimy-byerley/ethercrab that referenced this pull request May 12, 2023
* Return `&dyn Bikeshed` instead of `&mut dyn Bikeshed`

* Remove requirement to implement `SlaveGroupContainer`

* Remove SlaveGroup::as_mut
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.

Add a derive for SlaveGroupContainer
1 participant