object-type 0.1.1

struct Object - wrapper for anything type.
Documentation
  • Coverage
  • 75%
    3 out of 4 items documented2 out of 2 items with examples
  • Size
  • Source code size: 6.3 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 1.56 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 11s Average build duration of successful builds.
  • all releases: 11s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Documentation
  • Rusti-X/object-type-crate
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • Rusti-X

Object type

Object it's type, using a pointer to store any other types
But, it's not Object<T> it's just Object!
You don't need to specify a type template to create or type 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!");