add-ed 0.14.0

Embeddable pure rust editor based on ED
Documentation
use super::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)
///
/// Exists to provide a mutex mechanism for UIs which cannot do anything else
/// while an [`crate::IO`] is using the process' tty.
pub struct UILock<'a> {
  inner: &'a mut 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.
  pub fn new(ui: &'a mut dyn UI) -> Self {
    Self{inner: ui}
  }
}
impl Drop for UILock<'_> {
  fn drop(&mut self) {
    self.inner.unlock_ui();
  }
}