You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[ x ] I have looked for existing issues (including closed) about this
Feature Request
Motivation
Hi, I'm building a forum and want to implement dynamic permission system. My plan is every routing will insert themselves in a table with a unique key and I will handle it. Currently I need a way to list all of my routings. I need this kind of thing :
asyncfnpong() -> implIntoResponse{StatusCode::OK}fnmain(){let router = Router.new().route("/ping",get(pong));// I need this kind of thingfor routing in router {assert_eq!((ping, pong), routing);}}
Proposal
You obviously keep all routings to route them. I think you do it with hashmap. So I just need them to be exposed for developers somehow. I don't know if any drawback exists.
Alternatives
I also asked this in rust user forum -> https://users.rust-lang.org/t/list-all-routings/122725
and a person "parasyte" seems like solving my problem somehow but I think it could be nice if axum gives us a way to list routings since it can also be useful in other scenarios then mine.
I could use https://docs.rs/axum-routes/latest/axum_routes/ to keep all my routings in enum and I can somehow list them but it's another dependency for sure and it's main purpose is surely creating routings with enums with some compile, runtime checking. I think it's a useful crate but in my situation it seems a bit overkill.
The text was updated successfully, but these errors were encountered:
Duplicate of #2515. I'm sorry but we are not going to add this. You will have to write your own wrapper of the Router, or find a crate that does something like that. (aide and utoipa do something similar, if you need inspiration)
Duplicate of #2515. I'm sorry but we are not going to add this. You will have to write your own wrapper of the Router, or find a crate that does something like that. (aide and utoipa do something similar, if you need inspiration)
Sorry for duplication I checked for similar issues but couldn't find it.
Just for curiosity, why you don't want to do it ? Isn't it useful for devs ?
Feature Request
Motivation
Hi, I'm building a forum and want to implement dynamic permission system. My plan is every routing will insert themselves in a table with a unique key and I will handle it. Currently I need a way to list all of my routings. I need this kind of thing :
Proposal
You obviously keep all routings to route them. I think you do it with hashmap. So I just need them to be exposed for developers somehow. I don't know if any drawback exists.
Alternatives
I also asked this in rust user forum -> https://users.rust-lang.org/t/list-all-routings/122725
and a person "parasyte" seems like solving my problem somehow but I think it could be nice if axum gives us a way to list routings since it can also be useful in other scenarios then mine.
I could use https://docs.rs/axum-routes/latest/axum_routes/ to keep all my routings in enum and I can somehow list them but it's another dependency for sure and it's main purpose is surely creating routings with enums with some compile, runtime checking. I think it's a useful crate but in my situation it seems a bit overkill.
The text was updated successfully, but these errors were encountered: