Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.18 KB | None | 0 0
  1. use std::any::Any;
  2.  
  3. pub type Body = Box<dyn Any + Send + Sync + 'static>;
  4.  
  5. fn main() {
  6. let x: Body = Box::new(42u32);
  7. println!("Hello, world {}!", x.downcast::<u32>().unwrap());
  8. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement