Skip to main content

event_handler

Macro event_handler 

Source
macro_rules! event_handler {
    ($(#[$attr:meta])* fn $name:ident($event:ident, $data:ident) $body:block) => { ... };
}
Expand description

Define an ABI event handler whose body uses an EventView.

The generated trampoline contains the host’s ABI validity assumption and catches panics before they can unwind across extern "C". Payload strings copied by the view may safely be retained after the callback returns.