object-type

Crates.ioobject-type
lib.rsobject-type
version0.1.1
sourcesrc
created_at2023-09-15 18:01:39.984643
updated_at2023-09-15 19:30:16.791489
descriptionstruct Object - wrapper for anything type.
homepage
repositoryhttps://github.com/Rusti-X/object-type-crate.git
max_upload_size
id973852
size6,636
Rustix (Rusti-X)

documentation

https://github.com/Rusti-X/object-type-crate/blob/main/README.md

README

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!");  
Commit count: 12

cargo fmt