Skip to main content

run

Function run 

Source
pub fn run<T, R, F>(handler: F)
where T: DeserializeOwned, R: Serialize, F: FnOnce(Request<T>) -> Result<R, Error>,
Expand description

Run an action.

Installs the panic hook, reads the request, parses it into the handler’s input type, calls the handler, and reports the result — exactly once, whatever happens.

It returns nothing, because there is nobody to return to: the result travels to the host, and everything that could go wrong has already been turned into a failure the host can read.

Examples found in repository?
examples/close_duplicate_lead.rs (line 84)
83fn main() {
84    simple::run(handler)
85}
More examples
Hide additional examples
examples/file_expense_receipt.rs (line 92)
91fn main() {
92    simple::run(handler)
93}
examples/load_knowledge.rs (line 122)
121fn main() {
122    simple::run(handler)
123}