Skip to main content

Module host

Module host 

Source
Expand description

What diffr gives every plugin: git, the host interface of wit/plugin.wit. A plugin calls it the same way wherever it runs. In a component it calls the import. Natively, diffr runs each call of a plugin inside scope, with its own implementation of Host, and the function calls that.

Everything else a plugin needs it does itself: it reads files, and writes to stderr, which diffr captures and writes to its own.

Traits§

Host
diffr’s implementation of the host functions for one call of a native plugin.

Functions§

git
Run git with args in the repository’s working directory: its stdout when it exits successfully, its stderr otherwise.
scope
Run call, one call of a native plugin, with host behind the host function on this thread.