usesuper::UI;/// A simple object that locks UI and calls unlock_ui on it when being dropped
/// (Since it holds a mutable ref to UI its existence locks UI interaction)
pubstructUILock<'a>{inner:&'amut dyn UI,
}impl<'a>UILock<'a>{/// Construct a lock containing the given mutable reference
////// Locks the given [`UI`] (due to the borrow checker) until the created lock
/// is dropped, upon which it will call [`UI::unlock_ui`] before disappearing.
pubfnnew(ui:&'amut dyn UI)->Self{Self{inner: ui}}}implDrop forUILock<'_>{fndrop(&mutself){self.inner.unlock_ui();}}