SHARE
TWEET

Untitled

a guest Apr 19th, 2019 75 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. pub trait Clickable {
  2.     fn on_click(&mut self, callback: Option<Box<FnMut(&mut Clickable)>>);
  3.     fn click(&mut self, skip_callbacks: bool);
  4.  
  5.     fn as_clickable(&self) -> &dyn Clickable;
  6.     fn as_clickable_mut(&mut self) -> &mut dyn Clickable;
  7.     fn into_clickable(self: Box<Self>) -> Box<dyn Clickable>;
  8. }
  9.  
  10. pub trait Closeable {
  11.     fn on_close(&mut self, callback: Option<Box<FnMut(&mut Closeable)>>);
  12.     fn close(&mut self, skip_callbacks: bool);
  13.  
  14.     fn as_closeable(&self) -> &dyn Closeable;
  15.     fn as_closeable_mut(&mut self) -> &mut dyn Closeable;
  16.     fn into_closeable(self: Box<Self>) -> Box<dyn Closeable>;
  17. }
  18.  
  19. // ... etc
  20.  
  21. fn main() {}
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top