ke na
Posted on July 21, 2024
#[derive(Serialize, Deserialize)]
struct DirNode{
name:String,
children:Vec<DirNode>,
}
1:#[derive(Serialize, Deserialize)]
Making serialize and deserialize for struct to json
2:struct DirNode{}
Making struct named DirNode
3:children:Vec
'children' retain subdirectory's list.It means to make recursively storing a list of DirNode.
DirNode can contain multiple DirNode.
So 'children' can have subdirectories.
4:Vec
Making array can have multiple values by using heap allocation.
đź’– đź’Ş đź™… đźš©
ke na
Posted on July 21, 2024
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.
Related
rust Interview with Krzysztof Andrelczyk, Tauri Developer and Creator of Twili Recipes
September 5, 2024