The year’s coming to an end – who still Rusts on?
Over the last week, I started up http://intermezzos.github.io/ , and hopefully will get a lot more done on it this week.
Same as last week - Christmas does not a productive programmer make.
I published a pair of crates for interacting with the Z3 SMT solver. Very preliminary, just a handful of functions exposed in any convenient fashion. Mostly just bindgen output still.
Very nice experience, though. Y’all have improved rust a lot in the past couple years.
Working on my first “real-world” Rust project: rewriting one of our Python daemon with Rust + Iron + Hyper. Iron is an awesome framework - lightweight and with almost all the features I need.
A few struggles:
trying to write less verbose error handling code without too much
iron::typemap::Keytrait for a struct that has a reference field to a trait object (currently sovled by
Box<Obj + Send + Sync>)
live without global states (e.g.: MySQL db connections), which means I have to pass them around
Things not learned from tutorials (maybe I didn’t read thoroughly):
extern crateshould only be placed at
to_owned()for string literals
I’ve written a very small web application with rust and iron:
and I really like Iron and also had some small issues but luckily solved them after some research.
Regarding your third point:
Have you looked at iron persistent ? https://github.com/iron/persistent
(Or did you actually use it already and refer to the way it handles shared things with your second point (
I am currently experimenting if and how the ownership model can help with designing a good GUI library.
Thanks for your code. I’d look into that.
I put my global states inside an
Application struct, which is stored in
The tricky part is, every function that needs to talk to MySQL has an argument named
db_conn - currently this is fine, but what if they also use Redis, my app config, and so on? Maybe I just pass in the whole
Translating ownership, reference and borrowing into Azerbaijan language from Rust book