Closed Woodman3 closed 6 months ago
use serde::{Deserialize, Serialize}; use std::rc::Rc; use std::cell::RefCell; #[typetag::serde(tag="type")] pub trait Unit:std::fmt::Debug{} #[derive(Serialize,Deserialize)] // struct Teststruct(Rc<dyn Unit>); // it can complie struct Teststruct(Rc<RefCell<dyn Unit>>); //it can't complie