U+: pretty Unicode code point literals for Rust
Stop worrying about whether char literal syntax uses '\u{1234}', "\u1234", \x1E\x88\xB4 or something else, and use the True Unicode Syntax of U+1234!
I write about Rust things routinely. Here they all are.
Stop worrying about whether char literal syntax uses '\u{1234}', "\u1234", \x1E\x88\xB4 or something else, and use the True Unicode Syntax of U+1234!
#[cfg_attr(…, path = …)] for platform-specific module implementationsI wrote about #[cfg_attr] and some interesting use cases for it some years ago. Time for another dose!
<_>::v::<_>A fun little piece of Rust artwork.
Web frameworks normally have the concept of middleware; we’ve tried developing fancy fully type-safe middleware in Rust before, but not very successfully. I finally got it to work. Tween is the experimental result.
In order to truly understand Rust, one needs to understand its crucial differentiating feature: ownership. Let’s go through it in detail the hard way.
#[cfg_attr] attributeThe #[cfg_attr] attribute is a really handy way of reducing code duplication in some situations.
An exploration into some initially surprising but great parts of Rust (though you still may not like them).
Now we come to the Method type. While there are a few improvements to be made, this is one of the things that probably can’t be significantly improved on over rust-http.
Header representation is a critical matter to Teepee’s design: it is uncompromisingly strongly typed, but there must be tradeoffs. After trying quite a few different schemes at length, I have settled upon quite a novel scheme which I believe to optimally balance all considerations.
Status-Line, take twoMy first look at the Status-Line kept largely to what rust-http had done; some great discussion came up and a conceptual flaw in my models was revealed. Now I present some better options.
Status-Linerust-http has a nice Status enum which provides good, strong typing of statuses, but alas, it is not without its issues. Let’s take a look at the Status-Line as it is defined.
rust-http was but an experiment, an essay in the craft. Here, at last, is the real thing: the Teepee project, a properly engineered HTTP toolkit.
A presentation that I made to the San Fransisco Bay Area Rust meetup about the implementation side of Rust docs, and what I think should be used.