Crates.io | object-type |
lib.rs | object-type |
version | 0.1.1 |
source | src |
created_at | 2023-09-15 18:01:39.984643 |
updated_at | 2023-09-15 19:30:16.791489 |
description | struct Object - wrapper for anything type. |
homepage | |
repository | https://github.com/Rusti-X/object-type-crate.git |
max_upload_size | |
id | 973852 |
size | 6,636 |
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!");