um
so. procedural macros anyone
hi! this is a (extremely extremely minimal) web server i made! (however this is still probably my biggest project in rust to date)
i started with the template given by the rust book chapter 20, added minor error handling and a #[route] attribute proc macro and here we are :catsnug:
reworkboom done i just expanded the macro namually :peaceline:lazy_staticintegrationmake sure everything is tidy (all generated imports qualified correctly, file stuff)should be question markmovedone ! we have examples viamain.rsto outer crate and make this a libcargo run --example <example_name>now :3
fix where the import errors come fromdone! unless im missing other cases of this- generally clean stuff up (code quality review)
- check whether i actually need all those
clones (im suspicious i do) - read up on how to actually do multithreaded stuff in rust and rework as needed (surely it wont be too much :clueless:) (god this got . so much worse when i tried to implement proper error handling :catplant:)
- tidy up apis
- generally just "should this be public" and "are my function signatures cool and based or cringe as hell"
- check whether i actually need all those
- rework codegen in
#[route](im sure theres better ways to do everything i did)- just dicovered
quote_spannedexists im sure its useful
- just dicovered
do something about error handling indone! you pass anHttpServer::listenErrorHandlerand aNotFoundHandlertoHttpServer::newand if it errors it displays the page given by theErrorHandlerand if it can't find the requested route it displays the one given by theNotFoundHandler- however these are served at the route where the error happens
- this may be undesirable potentially but idk how to make them take u to a designated endpoint so u have to live with it for now :goodvibes:
- add support for more actual web features
- different request types
- more fully-featured responses
- serve other stuff than just bare html
- route trees? subroutes? routes with variable arguments??
- more attribute macros oooohhh
- make errors in macros more descriptive
- figure out and use proper spanned errors
- add all the cool stuff to my cargo.toml
- like descriptions and docs and repo link n stuff
- ohhhh fuc k. i have to write docs for everything :catresort:
- like descriptions and docs and repo link n stuff
- publish to crates.io!! (once ive got at least most of this)