i'm need to make url tree struct, like a sitemap.
Input: Vec - list of url
Expected Output: struct with nested hierarhy of url's, from root to endpoints.
Does it already existed crate or i need to make it myself?
Input:
{
"https://exapmle.com",
"https://exapmle.com/aa",
"https://exapmle.com/ab",
"https://exapmle.com/v",
"https://exapmle.com/zac",
"https://exapmle.com/zac/acf",
"https://exapmle.com/zac/acf/adr",
"https://exapmle.com/zac/axx"
}
Output:
UrlTree {
root: "https://exapmle.com",
Nodes: {
{
node: "aa",
Nodes: None,
},
{
node: "ab",
Nodes: None,
},
{
node: "v",
Nodes: None,
},
{
node: "zac",
Nodes: {
{
node: "acf",
Nodes: {
node: "adr",
Nodes: None,
}
},
{
node: "axx",
Nodes: None,
}
}
}
}
}
question from:
https://stackoverflow.com/questions/65879934/build-a-urltree-from-vecstring 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…