Earlier quoted context omitted.
It is readable, but you are right it is terribly formatted with a lot of not-very-important information in huge fonts. I think rustdoc needs quite a lot of work in general. For example it doesn't even give a list of methods at the start of each type's page. Want to know which methods you can call on a `String`? Enjoy scrolling... https://doc.rust-lang.org/std/string/struct.String.html
The +/- button will do that for you. It's one of the first things I do once I read the top example.
Rocket, Rust Web Framework, v0.2: Managed State and More
21–30 of 62 posts
Re: Rocket, Rust Web Framework, v0.2: Managed State and More
#22Earlier quoted context omitted.
It is readable, but you are right it is terribly formatted with a lot of not-very-important information in huge fonts. I think rustdoc needs quite a lot of work in general. For example it doesn't even give a list of methods at the start of each type's page. Want to know which methods you can call on a `String`? Enjoy scrolling... https://doc.rust-lang.org/std/string/struct.String.html
The +/- button will do that for you. It's one of the first things I do once I read the top example.
I definitely think the defaults should have everything except the description at the top collapsed.
Re: Rocket, Rust Web Framework, v0.2: Managed State and More
#23I've got an API server started in Iron, but I have to say the claims of productivity and less code overhead that Rocket is proclaiming seem pretty nice right about now.
Re: Rocket, Rust Web Framework, v0.2: Managed State and More
#24Just curious, I really want to like Rust but take a look at the State API documentation for managed state feature: https://api.rocket.rs/rocket/struct.State.html (screenshot: http://c.ekin.io/3c2q112x1p0y ) Is this readable to Rust people? I mean, can you look at this and say, "ah ok, I'm gonna call this and that then I'll have the state" directly? I'm lost but I have zero Rust knowledge so this is a sincere question…
Unfortunately Rust is not as revolutionary in this regard as in others :/ but other languages/ecosystems/tools are just as bad :(
Re: Rocket, Rust Web Framework, v0.2: Managed State and More
#25Just curious, I really want to like Rust but take a look at the State API documentation for managed state feature: https://api.rocket.rs/rocket/struct.State.html (screenshot: http://c.ekin.io/3c2q112x1p0y ) Is this readable to Rust people? I mean, can you look at this and say, "ah ok, I'm gonna call this and that then I'll have the state" directly? I'm lost but I have zero Rust knowledge so this is a sincere question…
Specifically, the first thing, inner(), says that you generally don't have to call it because there's a Deref implementation. Deref is a trait that lets you implement things that loosely resemble smart pointers or similar wrapper types: for instance, CString, which tracks a Rust-owned C-compatible string (null-terminated), has a Deref implementation to an array of bytes. So I know that I can usually use a State when a function seems likely to want an &T or Box or similar, and I can carry on and not care very much more until I need to.
The rest are trait implementations of common traits (Debug is like Python's repr, PartialEq and Eq are comparisons, etc.), and the documentation is from the trait. I think this is a rustdoc weakness, but I know about it, so I can ignore reading the docs.
Re: Rocket, Rust Web Framework, v0.2: Managed State and More
#26Just curious, I really want to like Rust but take a look at the State API documentation for managed state feature: https://api.rocket.rs/rocket/struct.State.html (screenshot: http://c.ekin.io/3c2q112x1p0y ) Is this readable to Rust people? I mean, can you look at this and say, "ah ok, I'm gonna call this and that then I'll have the state" directly? I'm lost but I have zero Rust knowledge so this is a sincere question…
But a few weeks in, it started to make total sense, and now I see the page you link to and I'm like «That's pretty clear, no problem here». It just takes a little time to get used to the documentation syntax and formatting I guess.
Re: Rocket, Rust Web Framework, v0.2: Managed State and More
#27Just curious, I really want to like Rust but take a look at the State API documentation for managed state feature: https://api.rocket.rs/rocket/struct.State.html (screenshot: http://c.ekin.io/3c2q112x1p0y ) Is this readable to Rust people? I mean, can you look at this and say, "ah ok, I'm gonna call this and that then I'll have the state" directly? I'm lost but I have zero Rust knowledge so this is a sincere question…
With rustdoc you have to click on the [-] in the top right to get an overview of the available methods.
But yes, once I have that overview I can usually pick out the methods I need. The type signatures can be a little complex, but so are C++ templates.
[0] http://download.java.net/java/jdk9/docs/api/java/util/Option...
Re: Rocket, Rust Web Framework, v0.2: Managed State and More
#28Just curious, I really want to like Rust but take a look at the State API documentation for managed state feature: https://api.rocket.rs/rocket/struct.State.html (screenshot: http://c.ekin.io/3c2q112x1p0y ) Is this readable to Rust people? I mean, can you look at this and say, "ah ok, I'm gonna call this and that then I'll have the state" directly? I'm lost but I have zero Rust knowledge so this is a sincere question…
If you know Rust, it's pretty easy to cut through it if you know what you're looking for, and sometimes it's actually useful.
Re: Rocket, Rust Web Framework, v0.2: Managed State and More
#29Re: Rocket, Rust Web Framework, v0.2: Managed State and More
#30Earlier quoted context omitted.
Are reverse proxies always the way to go?
No. Usually web application would be exposed through FastCGI or similar protocol. Insisting that either your tiny web application that can do next to nothing is the thing that owns 80/tcp (and/or 443/tcp) or runs behind a HTTP proxy is stupid. Proxying HTTP requests properly is harder than it sounds, which is surprising every now and then and thus is easy to screw up (what happens to Host: header? who is the TCP clie…
I only met FastCGI in PHP. All NodeJS apps I saw used HTTP.
Is there any benefit of doing it that way?
How does it work with WebSockets?