Advertisement
Guest User

Untitled

a guest
Apr 19th, 2019
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  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() {}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement