I have an api that returns the tree of a file, this api returns the name fields (file/folder name) and if it is a file it returns the content field with the content of the file and if it is a folder it returns children with the exact same structure. ie either there is a children field or there is a content
How to deploy this in a struct? I was thinking of making both fields optional and I did something like:
Maybe someone else can chime in with more details, but I've heard that tree structures are discouraged when first exploring the language. I recall something about getting stuck if you want to mutably walk the tree.