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

Закрито
dgriffen хоче об'єднати 3 комітів з dgriffen/rust.eventbus:dev/dgriffen/type-cancel в master
dgriffen прокоментував(ла) 2018-10-29 03:57:23 +01:00
First-time contributor

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 прокоментував(ла) 2018-10-29 03:59:24 +01:00
Автор
First-time contributor

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 прокоментував(ла) 2018-10-29 04:06:11 +01:00
Власник

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 прокоментував(ла) 2018-10-29 04:10:55 +01:00
Автор
First-time contributor

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 прокоментував(ла) 2018-10-29 04:15:31 +01:00
Власник

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 прокоментував(ла) 2018-10-29 04:21:59 +01:00
Автор
First-time contributor

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.
SoniEx2 закрив цей запит на злиття 2018-12-03 16:45:02 +01:00

Запит на злиття закрито

Підпишіться щоб приєднатися до обговорення.
Немає рецензентів
Без міток
Етап відсутній
Проєкт відсутній
Немає виконавців
2 учасників
Сповіщення
Дата завершення
Термін дії недійсний або знаходиться за межами допустимого діапазону. Будь ласка, використовуйте формат «рррр-мм-дд».

Термін виконання не встановлено.

Залежності

Залежностей не встановлено.

Reference: SoniEx2/rust.eventbus#1
Немає опису.