1

I mean a tree where every node has multiple children and every child refers back to its parent.

I've got this far:

pub struct Post {
    content: String,
    links: Vec<Post>,
    parent: Box<Post>,
}

impl Post {
    pub fn new() -> Post {
        Post {
            content: String::new(),
            links: Vec::new(),
            parent: Box::new(......),
        }
    }
}

What do I put in the place of the dots?

4

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.