Reference

Quickstart

Shuttle has a native integration for Rocket by default with the shuttle-rocket crate.

See the following code comparison below:

How does it work?

The Shuttle runtime exposes a trait, shuttle_runtime::Service, that services are required to implement before being able to run on Shuttle.

The shuttle-rocket crate exposes an aliased Result type (shuttle_rocket::ShuttleRocket) which simply wraps your router and implements From<T> which allows use of .into() on your Router. This integration includes serving the router itself.

If you want more custom behavior that is not supported by the native Shuttle integration, you can create a struct with your own custom implementation of shuttle_runtime::Service. You can find more about this here