Skip to content

Latest commit

 

History

History
17 lines (14 loc) · 515 Bytes

README.md

File metadata and controls

17 lines (14 loc) · 515 Bytes

Object type

Object it's type, using a pointer to store any other types
You don't need to specify a type template to create an Object.

And Object is structure, not trait!

You can use:

  let vec: Vec<Object> = vec![];  
  vec.push(obj!(472833));            // i32    [0]   
  vec.push(obj!("It's string!"));    // &str   [1]  
  vec.push(obj!(*Your type*));       // Other  [2]  
  // And get value with using get()  
  let string = vec[1].get::<&str>();  
  assert_eq(string, "It's string!");