0xMiden / 0xMiden/miden-vm

Events: Consider returning a `EventHandlerRegister` from `StdLibrary::handlers`

未关闭
#2,222 7 条评论 0 个 reaction 已指派 1 人 已被 @adr1anh 认领 在 GitHub 查看
processor
主要语言
Rust
星标
772
派生
352
平均合并
1 天 12 小时
30 天内合并 PR
93

描述

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.

贡献指南

打开贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。