Events: Consider returning a `EventHandlerRegister` from `StdLibrary::handlers`
- Ngôn ngữ chính
- Rust
- Star
- 772
- Fork
- 352
- Merge trung bình
- 1 ngày 12 giờ
- Pull request đã merge (30 ngày)
- 93
Mô tả
With the introduction of new the event handling infrastructure, users of `miden-vm` who implement their own `Host` need to manually handle these events. The straight forward approach is to define an `EventHandlerRegistry` for all library-defined events, which would be invoked as a fall-through if none of the native events match the one on the stack.
To make things easier, we make it a convention that libraries return an `EventHandlerRegister` directly which is easier to embed inside an existing `Host` implementation. The main drawback would be that we would then have multiple successive registries, but would make it simpler to include handlers from multiple registries.
As a bonus feature, we should also implement `EventHandler for EventHandlerRegistry` since a collection of handlers is itself a handler.
Hướng dẫn đóng góp
Đánh giá
Issue này chưa được đánh giá.