Function glib::source::fnmut_callback_wrapper_local

source ยท
fn fnmut_callback_wrapper_local(
    func: impl FnOnce() + 'static,
) -> impl FnMut() -> ControlFlow + 'static
Expand description

Transform a generic FnOnce into a closure that can be used as callback in various glib methods

The resulting function can only be called once and will panic otherwise. It will return ControlFlow::Break in order to prevent being called twice.

Different to fnmut_callback_wrapper(), this does not require func to be Send but can only be called from the thread that owns the main context.