I am referring to: anymap - Rust
Is there a way to:
-
add the restriction of: we can only store types that have Clone defined on them and
-
add the functionality of allowing the map to be cloned ?
I am referring to: anymap - Rust
Is there a way to:
add the restriction of: we can only store types that have Clone defined on them and
add the functionality of allowing the map to be cloned ?
I'm missing something obvious. How do I use this?
#[derive(Clone, Debug)]
pub struct Foo {
pub blah: AnyMap
}
is not compiling for me.
From the documentation:
If you want the entire map to be cloneable, use
CloneAny
instead ofAny
.
So instead of AnyMap
, which is a type alias for Map<Any>
, use Map<CloneAny>
.
This topic was automatically closed 90 days after the last reply. We invite you to open a new topic if you have further questions or comments.