70 %

Toast is in Beta!Learn more →

Chris Biscardi

Field Guide

Rust

A language empowering everyone to build reliable and efficient software.

Safer, faster programs

Rust’s industry-grade tools make collaboration fearless, allowing teams to focus on the tasks that matter.

Automation

Focus on the code that matters, leaving debates about semicolons in the past.

  • Rustfmt

    Rustfmt automatically formats Rust code, making it easier to read, write, and maintain. And most importantly: never debate spacing or brace position ever again.

  • Clippy

    Clippy builds on top of the Rust compiler to help you write more idomatic and efficient code.

  • Cargo Doc

    Documentation tooling built-in to the cargo package manager removes the barriers to writing and shipping documentation.

Rustlings

Take a guided tour of the Rust programming language from

  • Learn the basics

    Rust can be a very familiar langauge to people coming from JavaScript based backgrounds. Rustlings covers what you'll need to know to get up and running quickly.

  • Advanced Rust

    Rustlings also touches on more advanced concepts such as threading that developers in other langauges might not have been familiar with before.

A world of possibility

Build Discord bots, Serverless HTTP APIs, CLI tools for JS developers.

Discord

Rust's Serenity crate enables you to build async Discord bots with distributed tracing built-in.

  • Role Based Access Control

    Group commands and restrict access to using them, or even seeing them in the automated help output, using highly customizable role based access control.

  • Collectors

    Build rich user interactions by awaiting user input or reactions in the middle of control flow using collector streams.

  • Command Framework

    Organize your code with the Serenity Command Framework. Build async hooks to execute before every message, bucket commands into rate-limited groups, and handle errors in command execution.

Integrations

What can you do with Rust?

From building CLI tools to serverless functions, from parsing markdown to running Discord bots, Rust can handle a wide array of applications.

  • structopt

    Building a Rust CLI with subcommands using structopt and clap

    Using structopt we can derive our arguments from an enum to generate subcommands.

  • Serde

    Parsing Rust enums from JSON with Serde and tagged types

    JSON, being untyped, can represent multiple types in the same field. Serde can parse these into Rust enums in a few ways.

  • discord

    Automatically Pinning Spotify listening party messages in Discord with Serenity

  • Rust

    Are functions in Rust statements or expressions?

    A key insight into the Rust language is what an expression is and that they return values in tail position, leading to 'implicit returns'.

  • salsa

    On-Demand (lazy) inputs for incremental computation in salsa with file watching powered by notify in Rust

    The Salsa crate allows us to trigger incremental computation through input chagnes. When paired with file watching, we can trigger regeneration of derived queries through file changes.

  • language

    Checking for a minimum node version in Rust with Command

    Rust's Command allows us to execute subcommands and gather the output easily allowing us to do things like check for a node version when building tools for JS devs.

  • tooling

    Piping Rust code to rustfmt with configuration for shorter code examples in blog posts

    You can pipe code directly to rustfmt when sharing code on different platforms (or your blog) to make it more readable for other people.

  • parsing

    Custom Error types with Nom 5

    Parsing can result in many application specific errors. Here's how to signal that when using the Nom parser-combinator library.

  • tide

    Serving HTTP over unix domain sockets with Tide

    When building tools for JS devs, one way we can enable users to write JS that communicates with our Rust implementations is via sockets.

  • idiomatic

    Concatenating two string slices &str in Rust

    Using format! to concatenate two strings is idomatic Rust, even though it's not the absolute fastest way.

  • Processing realtime tweets from twitter in Rust

    Using egg_mode and the tokio runtime enables us to use streams and futures to pull in and process tweets.

Sign up for my free newsletter

My newsletter is where you'll find exclusive content from me. I write about technology, startups, and why you shouldn't call yourself a junior engineer