-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
static handler brings problems #10
Comments
@ptxmac I think this will be changed in #4 . The handler would be an instance of a struct that could store some variables. Just like this example. |
I've looked a bit more on my problem. It looks like I looked at the handle trait in Iron: https://github.com/iron/iron/blob/master/src/middleware/mod.rs#L58 and they managed to do it without |
|
Yeah, I'm struggling with lifetimes as well. I've kind of hit a wall where I need to clone my "router" I've thought about using I'm open to any thoughts or suggestions. |
I believe this will help in the future: rust-lang/rust#34511 In the future, I would suggest that we use |
handler has removed |
The
CoAPServer::handle
takes a'static
handler.I'm a bit new to rust, but I believe this means we can only use top level methods as handler, and then all state needed for the server will need to be stored in global variables?
As far as I understand it, this will also make the routing tool in #4 impossible.
Please correct me if I'm wrong!
The text was updated successfully, but these errors were encountered: