Function wilton_rusty::create_wilton_error[][src]

pub fn create_wilton_error(error_opt: Option<String>) -> *mut c_char

Create an error message, that can be passed back to Wilton

Helper function, that can be used with Rust Results, returned from wilton_rusty::register_wiltoncall function.

Arguments

  • error_opt - optional error message, that should be passed back to Wilton

Example

 // register a call
let res = wilton_rusty::register_wiltocall("hello", |obj: MyObj1| { hello(obj) });

 // check for error
if res.is_err() {
    // return error message to Wilton
    // return wilton_rusty::create_wilton_error(res.err());
    ()
}

 // return success status to Wilton
wilton_rusty::create_wilton_error(None)
()