impl From<&str> for MyStruct to parse the str and put it in some linked and nested MyStructs (like a special tree/leaves thing). For this I use a root
Rc<MyStruct>. But because I reference this root as parent in nested things the RcCounter as well the WeakCounter are above 1 and I can't get back
MyStruct to return it from this
More or less I pass parents like
As a workaround I've nested the real root in a pseudo-root I can return here. But I've this not very useful 1st level I've to step over when accessing
The best would be to
impl From<&str> for Rc<MyStruct> if this would be possible.
So of course I could create a
fn MyStruct::parse_from_str(s: &str) -> Rc<Self>.
But do you know the idiomatic Rust way this is mostly done?
I am also asking, because it feels very verbose to use Rc and RefCell to build up these linked stuff.