1 unstable release
Uses old Rust 2015
0.0.1 | Jul 4, 2015 |
---|
#46 in #convenience
8KB
The missing batteries of Rust
Rust is a blank canvas. You can create anything with Rust that your big beautiful brain can imagine. When you master Rust you will Be a Better Person.
But how do you create a fucking random number?
stdx is a curated collection of well-regarded Rust crates for typical programming tasks, as well as a single crate that combines them together in a customizable way for convenience. If you are a Rust newbie, stdx reveals the most legendary Crates in Rustendom that everybody else already knows about! Read these words and step up to the next level in the Temple of Rust.
Warning: stdx does not work yet. It is still mostly conceptual.
Getting started
Warning: Don't do this. It does not work. Instead read the recommended crates and link to them like the pros do.
Add this to your Cargo.toml:
[dependencies]
stdx = "0.102"
Then add this to the top of your crate source:
extern crate stdx;
Now you can access all of the crates in the revision of stdx that corresponds to the 1.2 release of the Rust compiler and language, and which will also work with all future 1.x revisions† of the Rust language!
Check it out:
extern crate stdx;
fn main() {
use stdx::rand::{self, rand::Rng};
let mut rng = rand::thread_rng();
println!("{}", rng.gen::<i32>())
}
That's how you create a fucking random number.
† Well, we'll try anyway. These libraries are popular and the Rust team will do their best not to break them.
Current batteries
The current revision of stdx is stdx-0.102.0
, which corresponds to
the Rust stable 1.2 release.
-
bitflags-0.3.0
- The only thing this crate does is export thebitflags!
macro, but it's a heckuva-useful macro.bitflags!
produces typesafe bitmasks, types with named values that are efficiently packed together as bits to express sets of options. -
docopt-0.6.67
- The preferred way to parse command line options in Rustland. Originally created by Rust API design pioneer, BurntSushi, it is used by Cargo and many other projects, but notably not by rustc and rustdoc, which use the oldergetopts
crate. -
env_logger-0.3.1
- In conjunction with thelog
crate, enables the output of logs to the console via theRUST_LOG
environment variable. This was a feature of the Rust language and runtime since ancient times, but is now implemented in an external library, and is still the most popular way to log information about what your Rust program is doing. -
flate2-0.2.7
- Basic deflate compression and decompression, via bindings to the miniz library. -
hyper-0.6.1
- The most full-featured pure-Rust implementation of HTTP. Trusted by Servo and maintained by Mozilla's seanmonstar so it's pretty solid.
Advanced details for the crate connoisseur
TODO: using crate features to enable crates selectively.
Past batteries
Rust 1.2 will be the first release for which stdx exists. There are no previous revisions yet.
Contributing and policy
stdx favors crates that have been 'battle-tested', this includes old
and unloved crates like libc
, crates that are used by the official
toolchain (which are maintained and highly-compatible if not always
beautiful), and crates that are otherwise popular and well maintained.
All crates must work on Rust's tier-1 platforms, currently x86 Linux, OS X, and Windows.
All crates must be published to crates.io along with documentation link and declared license.
License
stdx and the crates it links to are licensed under various permissive, BSD-like licenses. In lay-terms these licenses allow their code to be used and distributed freely, and are compatible with Rust's own license (MIT/Apache 2).
stdx itself is dual MIT/Apache 2 licensed, like Rust, and the copyright is owned by its contributors.
Dependencies
~10MB
~200K SLoC