emit_toplevel

Function emit_toplevel 

Source
pub fn emit_toplevel<'a, 'b, 'c>(
    s: &'c mut State<'a, 'b>,
    n: &str,
    ct: &'c Component<'b>,
)
Expand description

In addition to the items emitted by [emit_component], mutate s to emit:

  • a dummy Host type to reflect host functions
  • a toplevel Guest trait that can be implemented to provide access to any guest state
  • a hyperlight_guest_init function that registers all guest
  • functions when given a type that implements the Guest trait