Commit Graph

18 Commits

Author SHA1 Message Date
Daniel Welsh
3a54d079ae
Update pastebin example to avoid new gen reserved keyword; couple of typo fixes (#2975)
Pastebin example uses now deprecated `rand::gen()` which was changed due
to the reserved `gen` keyword in Rust 2024 edition.

Rather than changing dependencies or updating the guide to specify an
older edition, I've updated to use `gen_range` (should be best practice
to avoid an infinitesimal bias anyway). This should work with any
edition.

Also fixed typos I noticed in the CONTRIBUTING doc.

---------

Co-authored-by: Daniel Welsh <danielw2000@gmail.com>
Co-authored-by: Matthew Pomes <matthew.pomes@pm.me>
2025-12-28 12:27:38 -06:00
Nikita Samusev
4a410b75a9 Link directly to GitHub repo in quickstart guide. 2025-08-31 18:39:36 +02:00
iota
6c6ef5d439 Fix typo in requests guide: 'once' -> 'one'. 2025-08-31 18:38:00 +02:00
Paul Adenot
bcc784de73 Fix copies in Dockerfile in deploying guide. 2025-08-31 18:37:54 +02:00
Jonathan A. McCormick, Jr.
a607ede4df Fix typo in 12-pastebin.md: 'crate' -> 'create'. 2025-08-31 18:29:08 +02:00
Tim McCormack
fd75d0ccca Fix minor typos in guide and docstring 2024-10-21 20:51:58 -04:00
Azan Ali
de6632ea56 Improve wrapping responders guide section. 2024-08-28 10:47:20 -07:00
Sergio Benitez
72c91958b7 Support routes that match any method.
This commit introduces support for method-less routes and route
attributes, which match _any_ valid method: `#[route("/")]`. The `Route`
structure's `method` field is now accordingly of type `Option<Route>`.

The syntax for the `route` attribute has changed in a breaking manner.
To set a method, a key/value of `method = NAME` must be introduced:

```rust
#[route("/", method = GET)]
```

If the method's name is a valid identifier, it can be used without
quotes. Otherwise it must be quoted:

```rust
// `GET` is a valid identifier, but `VERSION-CONTROL` is not
#[route("/", method = "VERSION-CONTROL")]
```

Closes #2731.
2024-08-24 03:00:52 -07:00
Flozza
509a033c84
Fix wrong URL in guide (configuration) 2024-08-07 21:36:52 -05:00
Sergio Benitez
f50b6043e8 Improve FileServer rewrite API.
Finalizes the FileServer rewrite API implementation. Primarily reworks
how the built-in rewriters are written (now as structs instead of free
functions) and reorganizes the `fs` module.

Co-authored-by: Matthew Pomes <matthew.pomes@pm.me>
2024-07-06 15:34:21 +02:00
Vadim Anufriev
fb4b630405
Add MiniJinja for templating example (#2799)
Update guide to mention MiniJinja.
Adds MiniJinja to the templating example.
2024-06-26 01:27:44 -05:00
Arjen
cde1fb5de0 Improve example TOML in configuration guide. 2024-05-22 16:52:32 -05:00
Sergio Benitez
84072a813a Add deploying guide.
Resolves #171.
2024-04-25 20:03:44 -07:00
Sergio Benitez
836e64fec3 Rename 'Rocket::configure()' to 'reconfigure()'. 2024-04-25 14:47:43 -07:00
Sergio Benitez
0edbb6dad5 Document changeable TLS 'CryptoProvider's. 2024-03-31 11:46:56 -07:00
Sergio Benitez
1619bbbddc Support QUIC and HTTP/3.
This commit adds support for HTTP/3 and QUIC under a disabled-by-default
feature `http3-preview`. The current implementation depends on modified
versions of h3 and s2n-quic-h3 which will need to be upstreamed and
published before a release is possible.

During the course of development various facets of Rocket's internal
connection handling and recent listener APIs were improved. The complete
list of changes included in this PR is:

  * A `shutdown` module was introduced.
  * `config::Shutdown` was renamed to `ShutdownConfig` and moved to
    `shutdown` while being re-exported from `config`.
  * `ListenerAddr` is now called `Endpoint`. Various methods which
    previously referred to "addresses" now refer to "endpoints".
  * `Rocket::endpoint()` was renamed to `Rocket::endpoints()` and now
    returns an iterator over the endpoints Rocket is listening on.
  * `Endpoint` acquired various query utility methods.
  * The `{set_}remote()` methods now take/produce `Endpoint`s.
  * `TlsBindable` only accepts single-phase internal interfaces.
  * Bind error messages include candidate endpoint info when possible.
  * The warning message when a secret key is not configured now includes
    information about its effect on private cookies.

Internal changes include:

  * Config module tests were moved to `config/tests.rs`.
  * The cancellable I/O implementation was significantly simplified.
  * The `TripWire` implementation was simplified.
  * Individual shutdown stages can now be awaited on via `Stages`.
  * The `Shield` implementation was simplified.

Resolves #2723.
2024-03-18 20:23:22 -07:00
John Bampton
fd739bab4e Fix WebSocket FAQ entry, typos. 2024-03-04 12:37:29 -08:00
Sergio Benitez
8d3f1d65ac Reorganize and upgrade markup in site docs.
The guide is now in docs/guide. All other site assets are being migrated
to a separate repository.

The guide markup has been upgraded to take advantages of improvements in
the static site generator used to build the Rocket website.
2024-02-28 23:41:02 -08:00