Skip to content
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

Update to 1.2 #5

Open
jacquelinekay opened this issue Aug 22, 2015 · 5 comments
Open

Update to 1.2 #5

jacquelinekay opened this issue Aug 22, 2015 · 5 comments

Comments

@jacquelinekay
Copy link

1.2.0 is the latest stable version of Rust.

I started the effort in this branch, though it doesn't currently compile:

https://github.com/jacquelinekay/ros_rust/tree/update_to_1.2

(note: updating this library is my first foray into Rust, so no guarantees that anything I've done is correct!)

@tulku
Copy link

tulku commented Aug 27, 2015

Hi! We have been working on this also. Besides the changes you did, we are replacing the custom http and xml libraries for hyper and xml-rs. We got a bit delayed on making some changes to the xmlrpc library (to use the new libs and add some functionality). The xmlrpc library is located here: https://github.com/creativa77/xmlrpc-rs

@jacquelinekay
Copy link
Author

cool. In my branch, I think I've updated all the API changes that caused syntactical errors, but now I'm scratching my head over a type lifetime issue that's preventing compilation. Perhaps someone with more Rust experience than I can advise:

http/server.rs:27:32: 29:15 error: the parameter type `H` may not live long enough [E0310]
http/server.rs:27             Ok(stream) => pool.execute(move || {
http/server.rs:28                 handle_incoming_request(stream, handler_clone);
http/server.rs:29             }),
note: in expansion of for loop expansion
http/server.rs:22:5: 31:6 note: expansion site
http/server.rs:27:32: 29:15 help: run `rustc --explain E0310` to see a detailed explanation
http/server.rs:27:32: 29:15 help: consider adding an explicit lifetime bound `H: 'static`...
http/server.rs:27:32: 29:15 note: ...so that the type `[closure@http/server.rs:27:40: 29:14 stream:std::net::tcp::TcpStream, handler_clone:H]` will meet its required lifetime bounds
http/server.rs:27             Ok(stream) => pool.execute(move || {
http/server.rs:28                 handle_incoming_request(stream, handler_clone);
http/server.rs:29             }),

@jonbinney
Copy link
Owner

"H" is the type of the handler function, in this case, "handler_clone". Since this is a move closure, I would expect it to make a new copy of handler_clone anyway, so the lifetime shouldn't matter (I think?). So I'm not sure what is happening here.

I only wrote that http stuff because there wasn't a clear good http library when i started. I think that using hyper is the right way to do it. @tulku how well does xmlrpc-rs work? @jacquelinekay we should switch ros_rust over to use that since it uses hyper, and then this whole part of the code won't be needed anymore.

@jacquelinekay
Copy link
Author

Indeed, I can try integrating xmlrpc-rs if @tulku and co think it's ready
(or even if its just mostly ready and the API is there)
On Aug 30, 2015 10:16 PM, "Jonathan Binney" [email protected]
wrote:

"H" is the type of the handler function, in this case, "handler_clone".
Since this is a move closure, I would expect it to make a new copy of
handler_clone anyway, so the lifetime shouldn't matter (I think?). So I'm
not sure what is happening here.

I only wrote that http stuff because there wasn't a clear good http
library when i started. I think that using hyper is the right way to do it.
@tulku https://github.com/tulku how well does xmlrpc-rs work?
@jacquelinekay https://github.com/jacquelinekay we should switch
ros_rust over to use that since it uses hyper, and then this whole part of
the code won't be needed anymore.


Reply to this email directly or view it on GitHub
#5 (comment).

@tulku
Copy link

tulku commented Sep 1, 2015

Hi! Unfortunately, it is not ready... It's able to start a http server using hyper. I have a client that it is not merged. It has the beginning of a xml request parser, which only passes the one test. Hopefully I'll be able to put more hours into it these days. However, if somebody want to contribute to it, in any way, it's more than welcomed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants