pub(super) fn with_edit_lock_from_window<R>(
    this: &mut Object,
    mutable: bool,
    f: impl FnOnce(Box<dyn InputHandler>) -> R,
) -> Option<R> {
    let view_state = unsafe {
        let view_state: *mut c_void = *this.get_ivar("viewState");
        let view_state = &mut *(view_state as *mut ViewState);
        &mut (*view_state)
    };
    let input_token = view_state.active_text_input?;
    let handler = view_state.handler.acquire_input_lock(input_token, mutable);
    let r = f(handler);
    view_state.handler.release_input_lock(input_token);
    Some(r)
}
/// Acquires a lock to an `InputHandler`, passes it to a closure, and releases the lock.
Acquires a lock to an `InputHandler`, passes it to a closure, and releases the lock.
Acquires a lock to an ` InputHandler ` passes it to a closure and releases the lock .
pub(super) fn with_edit_lock_from_window<R>(
    this: &mut Object,
    mutable: bool,
    f: impl FnOnce(Box<dyn InputHandler>) -> R,
) -> Option<R> {
    let view_state = unsafe {
        let view_state: *mut c_void = *this.get_ivar("viewState");
        let view_state = &mut *(view_state as *mut ViewState);
        &mut (*view_state)
    };
    let input_token = view_state.active_text_input?;
    let handler = view_state.handler.acquire_input_lock(input_token, mutable);
    let r = f(handler);
    view_state.handler.release_input_lock(input_token);
    Some(r)
}
pub ( super ) fn with_edit_lock_from_window < R > ( this : & mut Object , mutable : bool , f : impl FnOnce ( Box < dyn InputHandler > ) -> R , ) -> Option < R > { let view_state = unsafe { let view_state : * mut c_void = * this . get_ivar ( " " ) ; let view_state = & mut * ( view_state as * mut ViewState ) ; & mut ( * view_state ) } ; let input_token = view_state . active_text_input ? ; let handler = view_state . handler . acquire_input_lock ( input_token , mutable ) ; let r = f ( handler ) ; view_state . handler . release_input_lock ( input_token ) ; Some ( r ) }
Acquires a lock to an `InputHandler`, passes it to a closure, and releases the lock.
Acquires a lock to an ` InputHandler ` passes it to a closure and releases the lock .
this
&mut Object
mutable
bool
f
impl FnOnce(Box<dyn InputHandler>) -> R
this
&mut Object
mutable
bool
f
impl FnOnce(Box<dyn InputHandler>) -> R