Hello everybody

I heard about Rust a few weeks ago and am very excited by this new language.
To get a grip I have created a simple web server, with the v0.5 of the language: https://github.com/schaars/simple-web-server It is quite limited, as it handles only 1 client at a time and HTTP 1.0 GET request, but it was interesting to write. Feel free to make any comment :)

I have a few questions about the language. I hope this mailing list is the right place to ask. 1) When I read a file, how can I make the difference between "file not found" and "not authorized to open file"? In my web server I cannot make it because in both cases the Result returned by io::read_whole_file() is Err(~"error opening file").

2) I have not found how to use a single channel (pipes::stream) between 1 sender and n receivers. Is it possible? The solution I found (but not implemented because I had a vector size problem (https://github.com/mozilla/rust/pull/5112)), is to create several channels and write to them in a round-robin manner, but it's not ideal.

3) The different pointer types seem to be implicitly converted. What happens when a conversion occurs? For instance if I convert a managed box to an owned box, the pointed variable is moved from the private heap to the exchange heap?

4) I have found a prototype error in http://static.rust-lang.org/doc/core/files/str-rs.html#bytes : the name of the function is to_bytes() instead of bytes(). By the way, this page is very useful but hard to find: I have not found any link from www.rust-lang.org

Best regards
Pierre Louis Aublin
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to