0xMiden / 0xMiden/miden-vm

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

Ouverte
#2,222 7 commentaires 0 réactions 1 personne assignée Réclamée par @adr1anh Voir sur GitHub
processor
Langage dominant
Rust
Étoiles
772
Forks
352
Merge moyen
1 j 12 h
PR mergées (30 j)
93

Description

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.

Guide de contribution

Ouvrir le guide de contribution

Évaluation

Cette issue n'a pas encore été évaluée.

Recevez les nouvelles issues par e-mail

Un résumé court des issues GitHub adaptées aux débutants.