webview_bind

Function webview_bind 

Source
pub unsafe extern "C" fn webview_bind(
    w: *mut c_void,
    name: *const i8,
    fn_: Option<unsafe extern "C" fn(*const i8, *const i8, *mut c_void)>,
    arg: *mut c_void,
) -> i32
Expand description

Binds a function pointer to a new global JavaScript function.

Internally, JS glue code is injected to create the JS function by the given name. The callback function is passed a request identifier, a request string and a user-provided argument. The request string is a JSON array of the arguments passed to the JS function.

@param w The webview instance. @param name Name of the JS function. @param fn Callback function. @param arg User argument. @retval WEBVIEW_ERROR_DUPLICATE A binding already exists with the specified name.