-1

I try to use the rocket::ignite() function like here. If I implement it in my code:

fn main() {
     rocket::ignite()
             .mount("/", routes![stream_controller::index])
             .mount("/events", routes![stream_controller::events])
             .launch();
}  

the only result is this error:

error[E0425]: cannot find function `ignite` in crate `rocket`
  --> src/main.rs:10:13
   |
10 |     rocket::ignite()
   |             ^^^^^^ not found in `rocket`

Do I have to import an extra module that is missing? The example code does not show an extra module. Maybe the ignite() is deprecated? I only can use the build() function with #[launch]. But in many examples like rocket-jwt they use ignite(). I'm really confused about using the Manual Launching.

cafce25
  • 15,907
  • 4
  • 25
  • 31
Jan
  • 93
  • 9

1 Answers1

3

You are most probably using Rocket 0.5, but the example you referred to is for Rocket 0.4. The ignite() function was removed in 0.5.

See build() if you are targeting 0.5. It's very similar to ignite() from 0.4.

Keep in mind 0.5 is a major rewrite, where lots of things have changed, so always make sure you're looking at the right documentation (the version is a part of the URL). Also, currently 0.5 is still in 0.5.0-rc.2, so you could expect some more things to change before it reaches a final state.

at54321
  • 8,726
  • 26
  • 46