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.


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


 // 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