pub trait IntoAny: Any {
// Required method
fn into_any(self: Arc<Self>) -> Arc<dyn Any + Send + Sync + 'static>;
}
Expand description
Trait to be used as a supertrait when an object should allow dynamic casting to an Any.
Separate trait since [into_any
] requires Self to be Sized, which cannot be satisfied in a
trait without preventing it from being object safe (thus disallowing dynamic dispatch).
Since we provide a generic implementation, the size of each concrete type is known.