[Rust]Making struct for getting directory path

#[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:childr…


This content originally appeared on DEV Community and was authored by ke na

#[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.


This content originally appeared on DEV Community and was authored by ke na


Print Share Comment Cite Upload Translate Updates
APA

ke na | Sciencx (2024-07-21T22:10:17+00:00) [Rust]Making struct for getting directory path. Retrieved from https://www.scien.cx/2024/07/21/rustmaking-struct-for-getting-directory-path/

MLA
" » [Rust]Making struct for getting directory path." ke na | Sciencx - Sunday July 21, 2024, https://www.scien.cx/2024/07/21/rustmaking-struct-for-getting-directory-path/
HARVARD
ke na | Sciencx Sunday July 21, 2024 » [Rust]Making struct for getting directory path., viewed ,<https://www.scien.cx/2024/07/21/rustmaking-struct-for-getting-directory-path/>
VANCOUVER
ke na | Sciencx - » [Rust]Making struct for getting directory path. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/07/21/rustmaking-struct-for-getting-directory-path/
CHICAGO
" » [Rust]Making struct for getting directory path." ke na | Sciencx - Accessed . https://www.scien.cx/2024/07/21/rustmaking-struct-for-getting-directory-path/
IEEE
" » [Rust]Making struct for getting directory path." ke na | Sciencx [Online]. Available: https://www.scien.cx/2024/07/21/rustmaking-struct-for-getting-directory-path/. [Accessed: ]
rf:citation
» [Rust]Making struct for getting directory path | ke na | Sciencx | https://www.scien.cx/2024/07/21/rustmaking-struct-for-getting-directory-path/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.