-
-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: make Sender
state publicly accessible
#69
base: main
Are you sure you want to change the base?
Conversation
todo: docs |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM once docs are added.
Okay, I added docs. I don't know exactly what you want because I don't know the specifics. |
I also made |
1b43294
to
b568333
Compare
Actually, I didn't end up needing to flush. |
/// Grab the state of the sender; the [`EventSet`] indices. | ||
pub fn state(&self) -> &ES::Indices { | ||
self.state | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually I would prefer a more specific name for this method.
/// Grab the state of the sender; the [`EventSet`] indices. | |
pub fn state(&self) -> &ES::Indices { | |
self.state | |
} | |
/// Get a reference to the [`EventSet`] indices of this sender. | |
pub fn indices(&self) -> &ES::Indices { | |
self.state | |
} |
pub fn world(&self) -> &UnsafeWorldCell<'a> { | ||
&self.world | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is currently unsound because UnsafeWorldCell::world
is safe to call. Mark UnsafeWorldCell::world
as unsafe and we should be good. UnsafeWorldCell
should also be made into a HandlerParam
at this point.
Edit: Actually, all of the methods on UnsafeWorldCell
should be unsafe.
This is useful for having a way to prepare events in a multi-threaded context before actually sending them in a single-threaded context.