Skip to content

Rusti-X/object-type-crate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

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!");  

About

struct Object - wrapper for anything type

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages