Speedy Rust framework for web apps burns through the sky

Share
  • December 14, 2018

Ready to code near the speed of light? Okay, maybe not that fast. We can’t break physics. But Rocket is an open source framework for Rust that makes writing web applications fast. The latest version, v.0.4 includes some impressive updates to the already great framework.

The into guide tells you all you need to know in order to pique your interest about this speedy spaceship:

Rocket aims to be fast, easy, and flexible while offering guaranteed safety and security where it can. Importantly, Rocket also aims to be fun, and it accomplishes this by ensuring that you write as little code as needed to accomplish your task.

https://rocket.rs/v0.4/guide/introduction/

SEE ALSO: New web framework alert: Meet Tower Web, the latest addition to Rust’s ecosystem

Features and uses

Why should you take Rocket for a spin?

Some of the features include:

  • TypeSafe: The overview describes the 3-step process that Rocket takes from request to response. Rust handles the routing, request pre-processing, and response post-processing
  • Easy to learn and use while focusing on security and “the path of least resistance”
  • Built-in templating support
  • View and remove cookies with or without encryption
  • Self-contained request handling
  • Built-in testing library
  • JSON support out of the box
  • Config environments
  • Open sourced under the Apache License Version 2.0 and the MIT License

Browse the extensive documentation for a quickstart guide, running examples, and an overview of Rocket. Getting started with the latest release is fairly simple. Of course, you will need to know Rust before you can soar.

You will need a nightly build of Rust in order to use Rocket. Why is this? According to GitHub, “it makes heavy use of syntax extensions”.

New additions

Rocket v0.4 is a major release with nearly a year of development behind it.

With the release, Rocket’s creator Sergio Benitez welcomes a co-maintainer to the table. Welcome on board Jeb Rosen!

Some of the new goodies:

  • Typed URIs: Build URIs to routes. The uri!macro creates a type-safe URI.
  • ORM agnostic database support: Connect a Rocket app to any of these databases: MySQL, Postgres, Sqlite, Neo4j, Redis, and MongoDB.
  • Request-Local State
  • Revamped queries string handling: The new query string handling fixes some previous issues in the past release
  • Disable CLI colors and emoji with ROCKET_CLI_COLORS=off.
  • Added Metadata guard
  • Codegen rewrite
  • Live template reloading without requiring recompilation
  • Stateful handlers
  • And much, much more

SEE ALSO: A new actor system that will add some polish to Rust

Review the changelog on GitHub for all the new features, breaking changes (of which there are many), and general improvements. All users are suggested to migrate to the latest release. For such a small team, the amount of ground covered in this release is impressive and shows a high amount of dedication!

What’s next? With this amount of momentum, Rocket has already passed Mars and is hurtling out of the solar system. Currently, the roadmap for v0.5 includes support for Rust stable, asynchronous request handling, multipart form support, and stronger CSRF and XSS protection.

As Rocket continues to grow towards v1.0, there is a high likelihood that it will become the number one choice for web development in Rust. For now, the roadmap is promising.

Do you agree with this prediction or do you recommend another framework?

The post Speedy Rust framework for web apps burns through the sky appeared first on JAXenter.

Source : JAXenter