Quantcast
Channel: Rust/rocket pass variable to endpoints - Stack Overflow
Browsing all 3 articles
Browse latest View live

Answer by MYZ for Rust/rocket pass variable to endpoints

Rocket makes it really easy to share resources between routes (and also between main or any other thread you might have spawned from main). They call their mechanism state. Check out its documentation...

View Article



Answer by kmdreko for Rust/rocket pass variable to endpoints

Rc is not thread safe, even behind a mutex. It looks like Rc is used in eng.blocker.pool.pool which is a lifeguard::Pool. So no, the Engine is not thread safe (at least by default).Fortunately, it...

View Article

Rust/rocket pass variable to endpoints

Not to my preference but I'm forced to write some Rust today so I'm trying to create a Rocket instance with only one endpoint but, on that endpoint I need to access a variable that is being created...

View Article
Browsing all 3 articles
Browse latest View live




Latest Images