-
-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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 ability to ignore field of bundle #5559
Comments
We already have a |
IMO we should be hygienic and use |
Serde uses "skip" fwiw |
Almost finished implementing this but I just realized that if you add a Or am I missing sth here? |
# Objective Fixes #5559 Replaces #5628 ## Solution Because the generated method from_components() creates an instance of Self my implementation requires any field type that is marked to be ignored to implement Default. --- ## Changelog Added the possibility to ignore fields in a bundle with `#[bundle(ignore)]`. Typically used when `PhantomData` needs to be added to a `Bundle`.
# Objective Fixes bevyengine#5559 Replaces bevyengine#5628 ## Solution Because the generated method from_components() creates an instance of Self my implementation requires any field type that is marked to be ignored to implement Default. --- ## Changelog Added the possibility to ignore fields in a bundle with `#[bundle(ignore)]`. Typically used when `PhantomData` needs to be added to a `Bundle`.
# Objective Fixes bevyengine#5559 Replaces bevyengine#5628 ## Solution Because the generated method from_components() creates an instance of Self my implementation requires any field type that is marked to be ignored to implement Default. --- ## Changelog Added the possibility to ignore fields in a bundle with `#[bundle(ignore)]`. Typically used when `PhantomData` needs to be added to a `Bundle`.
# Objective Fixes bevyengine#5559 Replaces bevyengine#5628 ## Solution Because the generated method from_components() creates an instance of Self my implementation requires any field type that is marked to be ignored to implement Default. --- ## Changelog Added the possibility to ignore fields in a bundle with `#[bundle(ignore)]`. Typically used when `PhantomData` needs to be added to a `Bundle`.
What problem does this solve or what need does it fill?
Add the ability to ignore a field of a bundle using the
#[derive(Bundle)]
macro, causing it to not be included in the generated list of components.This is primarily useful when working with
PhantomData
.What solution would you like?
Modify the derive Bundle macro to accomplish this :)
Be sure to add this to the
Bundle
docs as a doc test so this keeps working and can be discovered.The text was updated successfully, but these errors were encountered: