#1 Move cancellable to the type system and implement multi-parenting

Closed
dgriffen wants to merge 3 commits from dgriffen/rust.eventbus:dev/dgriffen/type-cancel into master

The dyn_events test was changed to produce the output requested in your sample here: https://bpaste.net/show/73d5e4bc55b4

The dyn_events test was changed to produce the output requested in your sample here: <https://bpaste.net/show/73d5e4bc55b4>
dgriffen commented 5 months ago
Poster

This is the output produced when run with cargo test -- --nocapture

Got event for inspection and manipulation: MyEventImpl { i: 3 }
Got event for inspection, manipulation, and cancellation: MyExtraEventImpl { i: 4 }
Got event for inspection and manipulation: MyExtraEventImpl { i: 4 }
This is the output produced when run with `cargo test -- --nocapture` ```text Got event for inspection and manipulation: MyEventImpl { i: 3 } Got event for inspection, manipulation, and cancellation: MyExtraEventImpl { i: 4 } Got event for inspection and manipulation: MyExtraEventImpl { i: 4 } ```
SoniEx2 commented 5 months ago
Owner

The output requested in my sample should be done as a separate test. And it should use asserts somehow.

This also doesn’t respect the hook priorities correctly.

The output requested in my sample should be done as a separate test. And it should use asserts somehow. This also doesn't respect the hook priorities correctly.
dgriffen commented 5 months ago
Poster

Hook priorities is quite a large problem with the way this system is implemented. Rust really doesn’t have a good built-in system for dynamic typing and downcasting which will have to be done in order to respect hook priorities since we’ll be mixing up handlers a lot.

Hook priorities is quite a large problem with the way this system is implemented. Rust really doesn't have a good built-in system for dynamic typing and downcasting which will have to be done in order to respect hook priorities since we'll be mixing up handlers a lot.
SoniEx2 commented 5 months ago
Owner

Some way to generate identifiers (for use in a large enum or somesuch) would work just as well, I think, altho I’m not quite sure how to do that.

Some way to generate identifiers (for use in a large enum or somesuch) would work just as well, I think, altho I'm not quite sure how to do that.
dgriffen commented 5 months ago
Poster

Ah yes, having the macro generate an enum large enough for each type would probably work great. I’m not sure if Rust supports turning a ty into an ident though.

Ah yes, having the macro generate an enum large enough for each type would probably work great. I'm not sure if Rust supports turning a `ty` into an `ident` though.
Please reopen this pull request to perform a merge.
Sign in to join this conversation.
No Label
No Milestone
No Assignees
2 Participants
Due Date

No due date set.

Dependencies

This pull request currently doesn't have any dependencies.

Loading…
Cancel
Save
There is no content yet.