Showing preview only (3,619K chars total). Download the full file or copy to clipboard to get everything.
Repository: rwf2/Rocket
Branch: master
Commit: 3a54d079aef0
Files: 686
Total size: 3.3 MB
Directory structure:
gitextract_jjluluj_/
├── .editorconfig
├── .gitattributes
├── .github/
│ ├── CODE_OF_CONDUCT.md
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug-report.yml
│ │ ├── config.yml
│ │ ├── doc-problem.yml
│ │ ├── feature-request.yml
│ │ └── suggestion.yml
│ └── workflows/
│ ├── ci.yml
│ └── trigger.yaml
├── .gitignore
├── .rustfmt.toml
├── CHANGELOG.md
├── CONTRIBUTING.md
├── Cargo.toml
├── LICENSE-APACHE
├── LICENSE-MIT
├── README.md
├── benchmarks/
│ ├── Cargo.toml
│ ├── src/
│ │ ├── bench.rs
│ │ └── routing.rs
│ └── static/
│ ├── bitwarden_rs.routes
│ └── rust-lang.routes
├── contrib/
│ ├── db_pools/
│ │ ├── README.md
│ │ ├── codegen/
│ │ │ ├── Cargo.toml
│ │ │ ├── src/
│ │ │ │ ├── database.rs
│ │ │ │ └── lib.rs
│ │ │ └── tests/
│ │ │ ├── ui-fail/
│ │ │ │ ├── database-syntax.rs
│ │ │ │ └── database-types.rs
│ │ │ ├── ui-fail-nightly/
│ │ │ │ ├── database-syntax.stderr
│ │ │ │ └── database-types.stderr
│ │ │ ├── ui-fail-stable/
│ │ │ │ ├── database-syntax.stderr
│ │ │ │ └── database-types.stderr
│ │ │ └── ui-fail.rs
│ │ └── lib/
│ │ ├── Cargo.toml
│ │ ├── src/
│ │ │ ├── config.rs
│ │ │ ├── database.rs
│ │ │ ├── diesel.rs
│ │ │ ├── error.rs
│ │ │ ├── lib.rs
│ │ │ └── pool.rs
│ │ └── tests/
│ │ └── databases.rs
│ ├── dyn_templates/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── src/
│ │ │ ├── context.rs
│ │ │ ├── engine/
│ │ │ │ ├── handlebars.rs
│ │ │ │ ├── minijinja.rs
│ │ │ │ ├── mod.rs
│ │ │ │ └── tera.rs
│ │ │ ├── fairing.rs
│ │ │ ├── lib.rs
│ │ │ ├── metadata.rs
│ │ │ └── template.rs
│ │ └── tests/
│ │ ├── templates/
│ │ │ ├── hbs/
│ │ │ │ ├── common/
│ │ │ │ │ ├── footer.html.hbs
│ │ │ │ │ └── header.html.hbs
│ │ │ │ ├── reload.txt.hbs
│ │ │ │ └── test.html.hbs
│ │ │ ├── j2/
│ │ │ │ ├── [test]/
│ │ │ │ │ └── html_test.html.j2
│ │ │ │ ├── base.txt.j2
│ │ │ │ ├── html_test.html.j2
│ │ │ │ └── txt_test.txt.j2
│ │ │ └── tera/
│ │ │ ├── [test]/
│ │ │ │ └── html_test.html.tera
│ │ │ ├── base.txt.tera
│ │ │ ├── html_test.html.tera
│ │ │ └── txt_test.txt.tera
│ │ └── templates.rs
│ ├── sync_db_pools/
│ │ ├── README.md
│ │ ├── codegen/
│ │ │ ├── Cargo.toml
│ │ │ ├── src/
│ │ │ │ ├── database.rs
│ │ │ │ └── lib.rs
│ │ │ └── tests/
│ │ │ ├── ui-fail/
│ │ │ │ ├── database-syntax.rs
│ │ │ │ └── database-types.rs
│ │ │ ├── ui-fail-nightly/
│ │ │ │ ├── database-syntax.stderr
│ │ │ │ └── database-types.stderr
│ │ │ ├── ui-fail-stable/
│ │ │ │ ├── database-syntax.stderr
│ │ │ │ └── database-types.stderr
│ │ │ └── ui-fail.rs
│ │ └── lib/
│ │ ├── Cargo.toml
│ │ ├── build.rs
│ │ ├── src/
│ │ │ ├── config.rs
│ │ │ ├── connection.rs
│ │ │ ├── error.rs
│ │ │ ├── lib.rs
│ │ │ └── poolable.rs
│ │ └── tests/
│ │ ├── databases.rs
│ │ ├── drop-with-connection.rs
│ │ └── shutdown.rs
│ └── ws/
│ ├── Cargo.toml
│ ├── README.md
│ └── src/
│ ├── duplex.rs
│ ├── lib.rs
│ └── websocket.rs
├── core/
│ ├── codegen/
│ │ ├── Cargo.toml
│ │ ├── src/
│ │ │ ├── attribute/
│ │ │ │ ├── async_bound/
│ │ │ │ │ └── mod.rs
│ │ │ │ ├── catch/
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ └── parse.rs
│ │ │ │ ├── entry/
│ │ │ │ │ ├── launch.rs
│ │ │ │ │ ├── main.rs
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ └── test.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── param/
│ │ │ │ │ ├── guard.rs
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ └── parse.rs
│ │ │ │ ├── route/
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ └── parse.rs
│ │ │ │ └── suppress/
│ │ │ │ ├── lint.rs
│ │ │ │ └── mod.rs
│ │ │ ├── bang/
│ │ │ │ ├── export.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── test_guide.rs
│ │ │ │ ├── typed_stream.rs
│ │ │ │ ├── uri.rs
│ │ │ │ └── uri_parsing.rs
│ │ │ ├── derive/
│ │ │ │ ├── form_field.rs
│ │ │ │ ├── from_form.rs
│ │ │ │ ├── from_form_field.rs
│ │ │ │ ├── from_param.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── responder.rs
│ │ │ │ └── uri_display.rs
│ │ │ ├── exports.rs
│ │ │ ├── http_codegen.rs
│ │ │ ├── lib.rs
│ │ │ ├── name.rs
│ │ │ ├── proc_macro_ext.rs
│ │ │ └── syn_ext.rs
│ │ └── tests/
│ │ ├── async-entry.rs
│ │ ├── async-routes.rs
│ │ ├── catcher.rs
│ │ ├── expansion.rs
│ │ ├── from_form.rs
│ │ ├── from_form_field.rs
│ │ ├── from_param.rs
│ │ ├── responder.rs
│ │ ├── route-data.rs
│ │ ├── route-format.rs
│ │ ├── route-ranking.rs
│ │ ├── route-raw.rs
│ │ ├── route-uniqueness.rs
│ │ ├── route.rs
│ │ ├── segment-ignore.rs
│ │ ├── typed-uris.rs
│ │ ├── ui-fail/
│ │ │ ├── async-entry.rs
│ │ │ ├── bad-ignored-segments.rs
│ │ │ ├── catch.rs
│ │ │ ├── catch_type_errors.rs
│ │ │ ├── catchers.rs
│ │ │ ├── from_form.rs
│ │ │ ├── from_form_field.rs
│ │ │ ├── from_form_type_errors.rs
│ │ │ ├── from_param.rs
│ │ │ ├── responder-types.rs
│ │ │ ├── responder.rs
│ │ │ ├── route-attribute-general-syntax.rs
│ │ │ ├── route-path-bad-syntax.rs
│ │ │ ├── route-type-errors.rs
│ │ │ ├── route-warnings.rs
│ │ │ ├── routes.rs
│ │ │ ├── synchronize.sh
│ │ │ ├── typed-uri-bad-type.rs
│ │ │ ├── typed-uris-bad-params.rs
│ │ │ ├── typed-uris-invalid-syntax.rs
│ │ │ ├── uri_display.rs
│ │ │ └── uri_display_type_errors.rs
│ │ ├── ui-fail-nightly/
│ │ │ ├── async-entry.stderr
│ │ │ ├── bad-ignored-segments.stderr
│ │ │ ├── catch.stderr
│ │ │ ├── catch_type_errors.stderr
│ │ │ ├── catchers.stderr
│ │ │ ├── from_form.stderr
│ │ │ ├── from_form_field.stderr
│ │ │ ├── from_form_type_errors.stderr
│ │ │ ├── from_param.stderr
│ │ │ ├── responder-types.stderr
│ │ │ ├── responder.stderr
│ │ │ ├── route-attribute-general-syntax.stderr
│ │ │ ├── route-path-bad-syntax.stderr
│ │ │ ├── route-type-errors.stderr
│ │ │ ├── route-warnings.stderr
│ │ │ ├── routes.stderr
│ │ │ ├── typed-uri-bad-type.stderr
│ │ │ ├── typed-uris-bad-params.stderr
│ │ │ ├── typed-uris-invalid-syntax.stderr
│ │ │ ├── uri_display.stderr
│ │ │ └── uri_display_type_errors.stderr
│ │ ├── ui-fail-stable/
│ │ │ ├── async-entry.stderr
│ │ │ ├── bad-ignored-segments.stderr
│ │ │ ├── catch.stderr
│ │ │ ├── catch_type_errors.stderr
│ │ │ ├── catchers.stderr
│ │ │ ├── from_form.stderr
│ │ │ ├── from_form_field.stderr
│ │ │ ├── from_form_type_errors.stderr
│ │ │ ├── from_param.stderr
│ │ │ ├── responder-types.stderr
│ │ │ ├── responder.stderr
│ │ │ ├── route-attribute-general-syntax.stderr
│ │ │ ├── route-path-bad-syntax.stderr
│ │ │ ├── route-type-errors.stderr
│ │ │ ├── route-warnings.stderr
│ │ │ ├── routes.stderr
│ │ │ ├── typed-uri-bad-type.stderr
│ │ │ ├── typed-uris-bad-params.stderr
│ │ │ ├── typed-uris-invalid-syntax.stderr
│ │ │ ├── uri_display.stderr
│ │ │ └── uri_display_type_errors.stderr
│ │ ├── ui-fail.rs
│ │ └── uri_display.rs
│ ├── http/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── ext.rs
│ │ ├── header/
│ │ │ ├── accept.rs
│ │ │ ├── content_type.rs
│ │ │ ├── header.rs
│ │ │ ├── known_media_types.rs
│ │ │ ├── media_type.rs
│ │ │ ├── mod.rs
│ │ │ └── proxy_proto.rs
│ │ ├── lib.rs
│ │ ├── method.rs
│ │ ├── parse/
│ │ │ ├── accept.rs
│ │ │ ├── checkers.rs
│ │ │ ├── indexed.rs
│ │ │ ├── media_type.rs
│ │ │ ├── mod.rs
│ │ │ └── uri/
│ │ │ ├── error.rs
│ │ │ ├── mod.rs
│ │ │ ├── parser.rs
│ │ │ ├── spec.txt
│ │ │ ├── tables.rs
│ │ │ └── tests.rs
│ │ ├── raw_str.rs
│ │ ├── status.rs
│ │ └── uri/
│ │ ├── absolute.rs
│ │ ├── asterisk.rs
│ │ ├── authority.rs
│ │ ├── error.rs
│ │ ├── fmt/
│ │ │ ├── encoding.rs
│ │ │ ├── formatter.rs
│ │ │ ├── from_uri_param.rs
│ │ │ ├── mod.rs
│ │ │ ├── part.rs
│ │ │ └── uri_display.rs
│ │ ├── host.rs
│ │ ├── mod.rs
│ │ ├── origin.rs
│ │ ├── path_query.rs
│ │ ├── reference.rs
│ │ ├── segments.rs
│ │ └── uri.rs
│ └── lib/
│ ├── Cargo.toml
│ ├── build.rs
│ ├── fuzz/
│ │ ├── .gitignore
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── corpus/
│ │ │ ├── collision-matching/
│ │ │ │ ├── another.seed
│ │ │ │ ├── base.seed
│ │ │ │ ├── complex.seed
│ │ │ │ └── large.seed
│ │ │ └── uri-parsing/
│ │ │ ├── absolute.seed
│ │ │ ├── asterisk.seed
│ │ │ ├── authority.seed
│ │ │ ├── origin.seed
│ │ │ └── reference.seed
│ │ └── targets/
│ │ ├── collision-matching.rs
│ │ ├── uri-normalization.rs
│ │ ├── uri-parsing.rs
│ │ └── uri-roundtrip.rs
│ ├── src/
│ │ ├── catcher/
│ │ │ ├── catcher.rs
│ │ │ ├── handler.rs
│ │ │ └── mod.rs
│ │ ├── config/
│ │ │ ├── cli_colors.rs
│ │ │ ├── config.rs
│ │ │ ├── http_header.rs
│ │ │ ├── ident.rs
│ │ │ ├── mod.rs
│ │ │ ├── secret_key.rs
│ │ │ └── tests.rs
│ │ ├── data/
│ │ │ ├── capped.rs
│ │ │ ├── data.rs
│ │ │ ├── data_stream.rs
│ │ │ ├── from_data.rs
│ │ │ ├── io_stream.rs
│ │ │ ├── limits.rs
│ │ │ ├── mod.rs
│ │ │ ├── peekable.rs
│ │ │ └── transform.rs
│ │ ├── erased.rs
│ │ ├── error.rs
│ │ ├── fairing/
│ │ │ ├── ad_hoc.rs
│ │ │ ├── fairings.rs
│ │ │ ├── info_kind.rs
│ │ │ └── mod.rs
│ │ ├── form/
│ │ │ ├── buffer.rs
│ │ │ ├── context.rs
│ │ │ ├── error.rs
│ │ │ ├── field.rs
│ │ │ ├── form.rs
│ │ │ ├── from_form.rs
│ │ │ ├── from_form_field.rs
│ │ │ ├── lenient.rs
│ │ │ ├── mod.rs
│ │ │ ├── name/
│ │ │ │ ├── buf.rs
│ │ │ │ ├── key.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── name.rs
│ │ │ │ └── view.rs
│ │ │ ├── options.rs
│ │ │ ├── parser.rs
│ │ │ ├── strict.rs
│ │ │ ├── tests.rs
│ │ │ └── validate.rs
│ │ ├── fs/
│ │ │ ├── file_name.rs
│ │ │ ├── mod.rs
│ │ │ ├── named_file.rs
│ │ │ ├── rewrite.rs
│ │ │ ├── server.rs
│ │ │ └── temp_file.rs
│ │ ├── http/
│ │ │ ├── cookies.rs
│ │ │ └── mod.rs
│ │ ├── lib.rs
│ │ ├── lifecycle.rs
│ │ ├── listener/
│ │ │ ├── bind.rs
│ │ │ ├── bounced.rs
│ │ │ ├── cancellable.rs
│ │ │ ├── connection.rs
│ │ │ ├── default.rs
│ │ │ ├── endpoint.rs
│ │ │ ├── listener.rs
│ │ │ ├── mod.rs
│ │ │ ├── quic.rs
│ │ │ ├── tcp.rs
│ │ │ └── unix.rs
│ │ ├── local/
│ │ │ ├── asynchronous/
│ │ │ │ ├── client.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── request.rs
│ │ │ │ └── response.rs
│ │ │ ├── blocking/
│ │ │ │ ├── client.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── request.rs
│ │ │ │ └── response.rs
│ │ │ ├── client.rs
│ │ │ ├── mod.rs
│ │ │ ├── request.rs
│ │ │ └── response.rs
│ │ ├── mtls/
│ │ │ ├── certificate.rs
│ │ │ ├── config.rs
│ │ │ ├── error.rs
│ │ │ ├── mod.rs
│ │ │ └── name.rs
│ │ ├── outcome.rs
│ │ ├── phase.rs
│ │ ├── request/
│ │ │ ├── atomic_method.rs
│ │ │ ├── from_param.rs
│ │ │ ├── from_request.rs
│ │ │ ├── mod.rs
│ │ │ ├── request.rs
│ │ │ └── tests.rs
│ │ ├── response/
│ │ │ ├── body.rs
│ │ │ ├── content.rs
│ │ │ ├── debug.rs
│ │ │ ├── flash.rs
│ │ │ ├── mod.rs
│ │ │ ├── redirect.rs
│ │ │ ├── responder.rs
│ │ │ ├── response.rs
│ │ │ ├── status.rs
│ │ │ └── stream/
│ │ │ ├── bytes.rs
│ │ │ ├── mod.rs
│ │ │ ├── one.rs
│ │ │ ├── raw_sse.rs
│ │ │ ├── reader.rs
│ │ │ ├── sse.rs
│ │ │ └── text.rs
│ │ ├── rocket.rs
│ │ ├── route/
│ │ │ ├── handler.rs
│ │ │ ├── mod.rs
│ │ │ ├── route.rs
│ │ │ ├── segment.rs
│ │ │ └── uri.rs
│ │ ├── router/
│ │ │ ├── collider.rs
│ │ │ ├── matcher.rs
│ │ │ ├── mod.rs
│ │ │ └── router.rs
│ │ ├── sentinel.rs
│ │ ├── serde/
│ │ │ ├── json.rs
│ │ │ ├── mod.rs
│ │ │ ├── msgpack.rs
│ │ │ └── uuid.rs
│ │ ├── server.rs
│ │ ├── shield/
│ │ │ ├── mod.rs
│ │ │ ├── policy.rs
│ │ │ └── shield.rs
│ │ ├── shutdown/
│ │ │ ├── config.rs
│ │ │ ├── handle.rs
│ │ │ ├── mod.rs
│ │ │ ├── sig.rs
│ │ │ └── tripwire.rs
│ │ ├── state.rs
│ │ ├── tls/
│ │ │ ├── config.rs
│ │ │ ├── error.rs
│ │ │ ├── listener.rs
│ │ │ ├── mod.rs
│ │ │ └── resolver.rs
│ │ ├── trace/
│ │ │ ├── level.rs
│ │ │ ├── macros.rs
│ │ │ ├── mod.rs
│ │ │ ├── subscriber/
│ │ │ │ ├── common.rs
│ │ │ │ ├── compact.rs
│ │ │ │ ├── dynamic.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── pretty.rs
│ │ │ │ ├── request_id.rs
│ │ │ │ └── visit.rs
│ │ │ └── traceable.rs
│ │ └── util/
│ │ ├── chain.rs
│ │ ├── join.rs
│ │ ├── mod.rs
│ │ ├── reader_stream.rs
│ │ └── unix.rs
│ └── tests/
│ ├── absolute-uris-okay-issue-443.rs
│ ├── adhoc-uri-normalizer.rs
│ ├── byte-slices-form-field-issue-2148.rs
│ ├── can-correct-bad-local-uri.rs
│ ├── can-launch-tls.rs
│ ├── catcher-cookies-1213.rs
│ ├── conditionally-set-server-header-996.rs
│ ├── config-proxy-proto-header.rs
│ ├── config-real-ip-header.rs
│ ├── config-secret-key-1500.rs
│ ├── content-length.rs
│ ├── cookies-private.rs
│ ├── derive-reexports.rs
│ ├── deserialize-limits-issue-2268.rs
│ ├── encoded-uris.rs
│ ├── fairing_before_head_strip-issue-546.rs
│ ├── file_server.rs
│ ├── flash-lazy-removes-issue-466.rs
│ ├── form-validation-names.rs
│ ├── form_method-issue-45.rs
│ ├── form_value_decoding-issue-82.rs
│ ├── form_value_from_encoded_str-issue-1425.rs
│ ├── forward-includes-status-1560.rs
│ ├── head_handling.rs
│ ├── http_serde.rs
│ ├── launch-inspect.rs
│ ├── limits.rs
│ ├── local-client-access-runtime-in-drop.rs
│ ├── local-client-json.rs
│ ├── local-request-content-type-issue-505.rs
│ ├── local_request_private_cookie-issue-368.rs
│ ├── many-cookie-jars-at-once.rs
│ ├── mapped-base-issue-1262.rs
│ ├── mount_point.rs
│ ├── msgpack_encoding.rs
│ ├── multipart-limit.rs
│ ├── nested-fairing-attaches.rs
│ ├── on_launch_fairing_can_inspect_port.rs
│ ├── panic-handling.rs
│ ├── precise-content-type-matching.rs
│ ├── raw-strings-multipart-files-1987.rs
│ ├── recursive-singleton-fairing.rs
│ ├── redirect_from_catcher-issue-113.rs
│ ├── replace-content-type-518.rs
│ ├── responder_lifetime-issue-345.rs
│ ├── route_guard.rs
│ ├── scoped-uri.rs
│ ├── segments-issues-41-86.rs
│ ├── sentinel.rs
│ ├── session-cookies-issue-1506.rs
│ ├── shield.rs
│ ├── shutdown-fairings.rs
│ ├── static/
│ │ ├── .hidden
│ │ ├── index.html
│ │ ├── inner/
│ │ │ ├── .hideme
│ │ │ ├── goodbye
│ │ │ └── index.html
│ │ └── other/
│ │ ├── hello.txt
│ │ └── index.htm
│ ├── strict_and_lenient_forms.rs
│ ├── timer-on-attach.rs
│ ├── tls-config-from-source-1503.rs
│ ├── twice_managed_state.rs
│ ├── typed-uri-docs-redef-issue-1373.rs
│ ├── unsound-local-request-1312.rs
│ ├── untracked-vs-tracked.rs
│ └── uri-percent-encoding-issue-808.rs
├── docs/
│ ├── LICENSE
│ ├── guide/
│ │ ├── 00-introduction.md
│ │ ├── 01-upgrading.md
│ │ ├── 02-quickstart.md
│ │ ├── 03-getting-started.md
│ │ ├── 04-overview.md
│ │ ├── 05-requests.md
│ │ ├── 06-responses.md
│ │ ├── 07-state.md
│ │ ├── 08-fairings.md
│ │ ├── 09-testing.md
│ │ ├── 10-configuration.md
│ │ ├── 11-deploying.md
│ │ ├── 12-pastebin.md
│ │ ├── 13-conclusion.md
│ │ ├── 14-faq.md
│ │ └── index.md
│ └── tests/
│ ├── Cargo.toml
│ └── src/
│ ├── guide.rs
│ ├── lib.rs
│ └── readme.rs
├── examples/
│ ├── Cargo.toml
│ ├── README.md
│ ├── chat/
│ │ ├── Cargo.toml
│ │ ├── src/
│ │ │ ├── main.rs
│ │ │ └── tests.rs
│ │ └── static/
│ │ ├── index.html
│ │ ├── reset.css
│ │ ├── script.js
│ │ └── style.css
│ ├── config/
│ │ ├── Cargo.toml
│ │ ├── Rocket.toml
│ │ └── src/
│ │ ├── main.rs
│ │ └── tests.rs
│ ├── cookies/
│ │ ├── Cargo.toml
│ │ ├── Rocket.toml
│ │ ├── src/
│ │ │ ├── main.rs
│ │ │ ├── message.rs
│ │ │ ├── session.rs
│ │ │ └── tests.rs
│ │ └── templates/
│ │ ├── login.html.hbs
│ │ ├── message.html.hbs
│ │ └── session.html.hbs
│ ├── databases/
│ │ ├── .sqlx/
│ │ │ ├── query-11e3096becb72f427c8d3911ef4327afd9516143806981e11f8e34d069c14472.json
│ │ │ ├── query-4415c35941e52a981b10707fe2e1ceb0bad0e473701e51ef21ecb2973c76b4df.json
│ │ │ ├── query-668690acaca0a0c0b4ac306b14d82aa1bee940f0776fae3f9962639b78328858.json
│ │ │ ├── query-79301b44b77802e0096efd73b1e9adac27b27a3cf7bf853af3a9f130b1684d91.json
│ │ │ └── query-bea4ef6e25064f6b383e854f8bc2770d89cfaf9859d0bfca78b2ca24627675b7.json
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── Rocket.toml
│ │ ├── db/
│ │ │ ├── diesel/
│ │ │ │ ├── migrations/
│ │ │ │ │ ├── .gitkeep
│ │ │ │ │ └── 20210329150332_create_posts_table/
│ │ │ │ │ ├── down.sql
│ │ │ │ │ └── up.sql
│ │ │ │ └── mysql-migrations/
│ │ │ │ └── 20210329150332_create_posts_table/
│ │ │ │ ├── down.sql
│ │ │ │ └── up.sql
│ │ │ └── sqlx/
│ │ │ └── migrations/
│ │ │ └── 20210331024424_create-posts-table.sql
│ │ └── src/
│ │ ├── diesel_mysql.rs
│ │ ├── diesel_sqlite.rs
│ │ ├── main.rs
│ │ ├── rusqlite.rs
│ │ ├── sqlx.rs
│ │ └── tests.rs
│ ├── error-handling/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── main.rs
│ │ └── tests.rs
│ ├── fairings/
│ │ ├── Cargo.toml
│ │ ├── Rocket.toml
│ │ └── src/
│ │ ├── main.rs
│ │ └── tests.rs
│ ├── forms/
│ │ ├── Cargo.toml
│ │ ├── Rocket.toml
│ │ ├── src/
│ │ │ ├── main.rs
│ │ │ └── tests.rs
│ │ └── templates/
│ │ ├── index.html.tera
│ │ ├── macros.html.tera
│ │ └── success.html.tera
│ ├── hello/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── main.rs
│ │ └── tests.rs
│ ├── manual-routing/
│ │ ├── Cargo.toml
│ │ ├── Rocket.toml
│ │ └── src/
│ │ ├── main.rs
│ │ └── tests.rs
│ ├── pastebin/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── main.rs
│ │ ├── paste_id.rs
│ │ └── tests.rs
│ ├── responders/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── main.rs
│ │ └── tests.rs
│ ├── serialization/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── json.rs
│ │ ├── main.rs
│ │ ├── msgpack.rs
│ │ ├── tests.rs
│ │ └── uuid.rs
│ ├── state/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── main.rs
│ │ ├── managed_hit_count.rs
│ │ ├── managed_queue.rs
│ │ ├── request_local.rs
│ │ └── tests.rs
│ ├── static-files/
│ │ ├── Cargo.toml
│ │ ├── src/
│ │ │ ├── main.rs
│ │ │ └── tests.rs
│ │ └── static/
│ │ ├── hidden/
│ │ │ ├── hi.txt
│ │ │ └── index.html
│ │ └── index.html
│ ├── templating/
│ │ ├── Cargo.toml
│ │ ├── Rocket.toml
│ │ ├── src/
│ │ │ ├── hbs.rs
│ │ │ ├── main.rs
│ │ │ ├── minijinja.rs
│ │ │ ├── tera.rs
│ │ │ └── tests.rs
│ │ └── templates/
│ │ ├── hbs/
│ │ │ ├── error/
│ │ │ │ └── 404.html.hbs
│ │ │ ├── footer.html.hbs
│ │ │ ├── index.html.hbs
│ │ │ ├── layout.html.hbs
│ │ │ └── nav.html.hbs
│ │ ├── minijinja/
│ │ │ ├── error/
│ │ │ │ └── 404.html.j2
│ │ │ ├── footer.html.j2
│ │ │ ├── index.html.j2
│ │ │ ├── layout.html.j2
│ │ │ └── nav.html.j2
│ │ └── tera/
│ │ ├── base.html.tera
│ │ ├── error/
│ │ │ └── 404.html.tera
│ │ ├── index.html.tera
│ │ └── nav.html.tera
│ ├── testing/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── async_required.rs
│ │ └── main.rs
│ ├── tls/
│ │ ├── Cargo.toml
│ │ ├── Rocket.toml
│ │ ├── private/
│ │ │ ├── ca_cert.pem
│ │ │ ├── ca_key.pem
│ │ │ ├── client.pem
│ │ │ ├── ecdsa_nistp256_sha256.p12
│ │ │ ├── ecdsa_nistp256_sha256_cert.pem
│ │ │ ├── ecdsa_nistp256_sha256_key_pkcs8.pem
│ │ │ ├── ecdsa_nistp256_sha256_key_sec1.pem
│ │ │ ├── ecdsa_nistp384_sha384.p12
│ │ │ ├── ecdsa_nistp384_sha384_cert.pem
│ │ │ ├── ecdsa_nistp384_sha384_key_pkcs8.pem
│ │ │ ├── ecdsa_nistp384_sha384_key_sec1.pem
│ │ │ ├── ecdsa_nistp521_sha512.p12
│ │ │ ├── ecdsa_nistp521_sha512_cert.pem
│ │ │ ├── ecdsa_nistp521_sha512_key_pkcs8.pem
│ │ │ ├── ed25519.p12
│ │ │ ├── ed25519_cert.pem
│ │ │ ├── ed25519_key.pem
│ │ │ ├── gen_certs.sh
│ │ │ ├── rsa_sha256.p12
│ │ │ ├── rsa_sha256_cert.pem
│ │ │ └── rsa_sha256_key.pem
│ │ └── src/
│ │ ├── main.rs
│ │ ├── redirector.rs
│ │ └── tests.rs
│ ├── todo/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── Rocket.toml
│ │ ├── db/
│ │ │ └── DB_LIVES_HERE
│ │ ├── migrations/
│ │ │ ├── .gitkeep
│ │ │ └── 20160720150332_create_tasks_table/
│ │ │ ├── down.sql
│ │ │ └── up.sql
│ │ ├── src/
│ │ │ ├── main.rs
│ │ │ ├── task.rs
│ │ │ └── tests.rs
│ │ └── static/
│ │ ├── css/
│ │ │ ├── normalize.css
│ │ │ ├── skeleton.css
│ │ │ └── style.css
│ │ └── index.html.tera
│ └── upgrade/
│ ├── Cargo.toml
│ ├── src/
│ │ └── main.rs
│ └── static/
│ └── index.html
├── scripts/
│ ├── config.sh
│ ├── mk-docs.sh
│ ├── publish.sh
│ └── test.sh
└── testbench/
├── Cargo.toml
└── src/
├── client.rs
├── config.rs
├── lib.rs
├── main.rs
├── runner.rs
├── server.rs
└── servers/
├── bind.rs
├── http_extensions.rs
├── ignite_failure.rs
├── infinite_stream.rs
├── mod.rs
├── mtls.rs
├── no_content.rs
├── sni_resolver.rs
├── tls.rs
├── tls_resolver.rs
└── tracing.rs
================================================
FILE CONTENTS
================================================
================================================
FILE: .editorconfig
================================================
root = true
[*.rs]
insert_final_newline = true
trim_trailing_whitespace = true
indent_style = space
indent_size = 4
tab_width = 4
================================================
FILE: .gitattributes
================================================
* text eol=lf
# Denote all files that are truly binary and should not be modified.
*.png binary
*.jpg binary
*.gif binary
*.svg binary
================================================
FILE: .github/CODE_OF_CONDUCT.md
================================================
# Rocket Community Code of Conduct
Like the technical community as a whole, the Rocket project, its teams, and its
community are made up of a mixture of professionals and volunteers from all over
the world, working on every aspect of the mission. Diversity is one of our huge
strengths, but it can also lead to communication issues and unhappiness. To that
end, we have a few ground rules that we ask people to adhere to. This code
applies equally to everyone in our community: maintainers, contributors, team
leads, mentors, those seeking help and guidance, and so on.
This isn’t an exhaustive list of things that you can’t do. Rather, take it in
the spirit in which it’s intended - a guide to make it easier to enrich all of
us and the technical communities in which we participate.
_If you believe someone is violating the code of conduct, we ask that you report
it by emailing community@rwf2.org._
- **Be friendly. Be Kind. Be patient.**
- **Be welcoming.** We strive to be a community that welcomes and supports
everyone, of all backgrounds and identities. This includes, but is not limited
to members of any race, ethnicity, culture, national origin, color,
immigration status, social and economic class, educational level, sex, sexual
orientation, gender identity and expression, age, size, family status,
political belief, religion, and mental and physical ability.
- **Be considerate.** Your work will be used by other people, and you in turn
will depend on the work of others. Any decision you take will affect users and
colleagues, and you should take those consequences into account when making
decisions. Remember that we're a global community, so you might not be
communicating in someone else's primary language.
- **Be respectful.** We won't all agree all the time, but disagreement isn't an
excuse for poor behavior or poor manners. While frustrations may occasionally
arise, we cannot allow those frustrations to turn into personal attacks.
Remember that a community where people feel uncomfortable or threatened is not
a productive one. Be respectful, not just to fellow community members, but to
individuals outside the community as well.
- **Be careful in the words that you choose.** We are a community of
professionals, and we conduct ourselves professionally. Do not insult or put
down other participants. Harassment and other exclusionary behavior aren't
acceptable. This includes, but is not limited to:
- Violent threats or language directed against another person.
- Discriminatory jokes and language.
- Posting sexually explicit or violent material.
- Posting (or threatening to post) other people's personally identifying
information ("doxing").
- Personal insults, especially those using racist or sexist terms.
- Unwelcome sexual attention.
- Advocating for, or encouraging, any of the above behavior.
- Repeated harassment of others. In general, if someone asks you to stop, then
stop.
- **Be understanding.** Disagreements, both social and technical, happen all the
time. It is important that we resolve differing views constructively. When we
disagree, try to understand why. Our community consists of people from a wide
range of backgrounds. Different people have different perspectives on issues.
Being unable to understand why someone holds a viewpoint doesn’t mean that
they’re wrong. Don’t forget that it is human to err; blame accomplishes
nothing. Instead, focus on helping to resolve issues and learning from
mistakes.
_This code of conduct applies to all spaces managed by Rocket or the Rocket Web
Framework Foundation including issues and discussions on GitHub, Matrix, and any
other forums which the community uses for communication._
_This Code of Conduct is adapted from the [Django Code of Conduct]. Original text
from the [Speak Up! project]._
[Django Code of Conduct]: https://www.djangoproject.com/conduct/
[Speak Up! project]: http://web.archive.org/web/20141109123859/http://speakup.io/coc.html
================================================
FILE: .github/FUNDING.yml
================================================
github: rwf2
open_collective: rwf2
================================================
FILE: .github/ISSUE_TEMPLATE/bug-report.yml
================================================
name: Bug Report
description: Report a functionality issue that deviates from the documentation.
labels: ["triage"]
body:
- type: markdown
attributes:
value: >
**Thanks for taking the time to fill out this bug report!** Your report
helps make Rocket better.
Please only report issues related to _functionality_ that deviates from
published specification or reasonable expectation. Do not report issues
with documentation, infrastructure, or anything unrelated to functional
correctness here.
- type: input
attributes:
label: Rocket Version
description: >
Enter the exact version of Rocket (x.y.z) or git shorthash (8d9dfce) you're using.
Please ensure you're using the latest release before reporting a bug.
placeholder: "ex: 0.5.0"
validations:
required: true
- type: input
attributes:
label: Operating System
description: Which operating system and version are you running?
placeholder: "examples: macOS 13.6.2, Arch Linux 4.16.13"
validations:
required: true
- type: input
attributes:
label: Rust Toolchain Version
description: Which version of `rustc` are you using? (`rustc --version`)
placeholder: "ex: rustc 1.74.0 (79e9716c9 2023-11-13)"
validations:
required: true
- type: textarea
attributes:
label: What happened?
description: Provide a brief overview of what went wrong.
validations:
required: true
- type: textarea
attributes:
label: Test Case
description: >
Provide a Rocket application that elicits the bug. Ideally the program
contains a `#[test]` case using Rocket's
[`local`](https://api.rocket.rs/v0.5/rocket/local/index.html) testing
module.
placeholder: >
#[macro_use] extern crate rocket;
#[launch]
fn rocket() -> _ {
rocket::build()
}
#[test]
fn failing_test() {
use rocket::local::blocking::Client;
let client = Client::tracked(rocket()).unwrap();
let response = client.get("/").dispatch();
assert!(response.status().class().is_success());
}
render: rust
validations:
required: true
- type: textarea
attributes:
label: Log Output
description: >
Please provide the complete log output captured with
`ROCKET_LOG_LEVEL=debug` when the test case is run.
placeholder: >
❯ ROCKET_LOG_LEVEL=debug cargo test
running 1 test
test failing_test ... FAILED
failures:
---- failing_test stdout ----
-- configuration trace information --
>> "address" parameter source: rocket::Config::default()
>> "port" parameter source: rocket::Config::default()
>> "workers" parameter source: rocket::Config::default()
>> "max_blocking" parameter source: rocket::Config::default()
>> "keep_alive" parameter source: rocket::Config::default()
>> "ident" parameter source: rocket::Config::default()
>> "ip_header" parameter source: rocket::Config::default()
>> "limits" parameter source: rocket::Config::default()
>> "temp_dir" parameter source: rocket::Config::default()
>> "log_level" parameter source: `ROCKET_` environment variable(s)
>> "shutdown" parameter source: rocket::Config::default()
>> "cli_colors" parameter source: rocket::Config::default()
🔧 Configured for debug.
>> address: 127.0.0.1
>> port: 8000
[...]
render: shell
validations:
required: true
- type: textarea
attributes:
label: Additional Context
description: >
Feel free to provide any additional context for your bug report.
- type: checkboxes
attributes:
label: System Checks
description: "Please confirm all of the following:"
options:
- label: My bug report relates to functionality.
required: true
- label: I have tested against the latest Rocket release or a recent git commit.
required: true
- label: I have tested against the latest stable `rustc` toolchain.
required: true
- label: I was unable to find this issue previously reported.
required: true
================================================
FILE: .github/ISSUE_TEMPLATE/config.yml
================================================
blank_issues_enabled: true
contact_links:
- name: FAQ
url: https://rocket.rs/guide/faq/
about: Please see our FAQ for answers to common questions.
- name: Questions
url: https://github.com/rwf2/Rocket/discussions/new?category=questions
about: For other questions or help, please use GitHub discussions.
- name: Feedback
url: https://github.com/rwf2/Rocket/discussions/new/choose
about: For general chat or feedback, please use GitHub discussions.
- name: Chat
url: https://chat.mozilla.org/#/room/#rocket:mozilla.org
about: Chat with us live on rocket:mozilla.org on Matrix.
================================================
FILE: .github/ISSUE_TEMPLATE/doc-problem.yml
================================================
name: Documentation Problem
description: Report an issue with or suggest documentation.
labels: ["docs"]
body:
- type: markdown
attributes:
value: >
**Thanks for taking the time to report a documentation issue!**
Documentation problems include everything from typos to missing or
incorrect technical details in any of the following:
- [Rocket's Website](https://rocket.rs/)
- [The Rocket Programming Guide](https://rocket.rs/guide/)
- [API Docs](https://api.rocket.rs)
- [Content on GitHub](https://github.com/rwf2/Rocket)
If we've written it, we want to know how it can be improved.
- type: dropdown
validations:
required: true
attributes:
label: What kind of documentation problem are you reporting?
multiple: true
options:
- Typo (PRs welcome!)
- Unclear Docs
- Undocumented Feature
- Broken Links
- Rendering Issue
- Grammar Issue
- Technical Problem
- Other
- type: input
validations:
required: true
attributes:
label: Where is the issue found?
description: Please provide a direct link to the documentation.
placeholder: "ex: https://rocket.rs/v0.5/guide/requests/#multiple-segments"
- type: textarea
validations:
required: true
attributes:
label: What's wrong?
description: >
Please describe what's wrong with the documentation.
- type: checkboxes
attributes:
label: System Checks
description: "Please confirm all of the following:"
options:
- label: I confirmed that the issue still exists on `master` on GitHub.
required: true
- label: I was unable to find a previous report of this problem.
required: true
================================================
FILE: .github/ISSUE_TEMPLATE/feature-request.yml
================================================
name: Feature Request
description: Propose a change that introduces new functionality.
labels: ["request"]
body:
- type: markdown
attributes:
value: >
**Thanks for taking the time to request a feature!** Your request helps
make Rocket better.
Please note that Rocket is designed to have a small but pluggable core.
Feature requests that can be implemented outside of Rocket _are
typically declined._ In your request, please make a strong case for why
this feature can't or shouldn't be implemented outside of Rocket.
- type: textarea
attributes:
label: What's missing?
description: >
Provide a brief overview of the functionality that's missing in Rocket
today, which problem(s) that functionality would solve for you, and what
the functionality would enable you to do.
placeholder: >
example: I frequently want to do X, but Rocket makes it hard. It would
be nice if Rocket...
example: I want to do X but Rocket makes it impossible because...
example: Feature Z exists, but it has these N drawbacks: [..]. What if...
validations:
required: true
- type: textarea
attributes:
label: Ideal Solution
description: >
If you already have an idea of how this feature can be implemented,
please describe it here. Hypothetical code examples are particularly
useful.
- type: textarea
attributes:
label: Why can't this be implemented outside of Rocket?
description: >
Please make a strong case for why this feature can't or shouldn't be
implemented outside of Rocket. We are likely to decline feature requests
that can exist outside of Rocket without compromise.
validations:
required: true
- type: textarea
attributes:
label: Are there workarounds usable today?
description: >
If the functionality being requested can be achieved today, please detail
how here.
- type: textarea
attributes:
label: Alternative Solutions
description: >
If you have other ideas about how this feature can be implemented, let
us know.
- type: textarea
attributes:
label: Additional Context
description: >
Feel free to provide any additional context for your request.
- type: checkboxes
attributes:
label: System Checks
description: "Please confirm all of the following:"
options:
- label: I do not believe that this feature can or should be implemented outside of Rocket.
required: true
- label: I was unable to find a previous request for this feature.
required: true
================================================
FILE: .github/ISSUE_TEMPLATE/suggestion.yml
================================================
name: Suggestion
description: Suggest a change or improvement to existing functionality.
labels: ["suggestion"]
body:
- type: markdown
attributes:
value: >
**Thanks for taking the time to make a suggestion!**
- type: input
validations:
required: true
attributes:
label: API Docs to Existing Functionality
description: Please provide a direct link to the API docs for the
functionality you'd like to change.
placeholder: "ex: https://api.rocket.rs/v0.5/rocket/trait.Sentinel.html"
- type: textarea
validations:
required: true
attributes:
label: Problems with Existing Functionality
description: Please let us know what you think is wrong with the existing functionality.
placeholder: >
example: Sentinels don't allow me to access `Foo`, but I'd like to because...
example: Feature Z exists, but it has these drawbacks. What if...
- type: textarea
validations:
required: true
attributes:
label: Suggested Changes
description: >
How do you propose the existing functionality be changed? Code examples
are particular useful.
- type: textarea
validations:
required: true
attributes:
label: Alternatives Considered
description: >
Instead of making a change to Rocket, please describe alternative
solutions using existing features or new features you've considered.
- type: textarea
attributes:
label: Additional Context
description: Feel free to provide any additional context for your suggestion.
- type: checkboxes
attributes:
label: System Checks
description: "Please confirm all of the following:"
options:
- label: >
I do not believe that this suggestion can or should be implemented
outside of Rocket.
required: true
- label: I was unable to find a previous suggestion for this change.
required: true
================================================
FILE: .github/workflows/ci.yml
================================================
name: CI
on: [push, pull_request]
env:
CARGO_TERM_COLOR: always
jobs:
test:
name: "${{ matrix.platform.name }} ${{ matrix.test.name }} (${{ matrix.platform.toolchain }})"
runs-on: ${{ matrix.platform.distro }}
strategy:
fail-fast: false
matrix:
platform:
- { name: Linux, distro: ubuntu-latest, toolchain: stable }
- { name: Windows, distro: windows-latest, toolchain: stable }
- { name: macOS, distro: macOS-latest, toolchain: stable }
- { name: Linux, distro: ubuntu-latest, toolchain: nightly }
test:
- { name: Debug }
- { name: Examples, flag: "--examples" }
- { name: Contrib, flag: "--contrib" }
include:
# Additional tests on Linux/stable.
- platform: { name: Linux, distro: ubuntu-latest, toolchain: stable }
test: { name: Core, flag: "--core" }
- platform: { name: Linux, distro: ubuntu-latest, toolchain: stable }
test: { name: Release, flag: "--release" }
- platform: { name: Linux, distro: ubuntu-latest, toolchain: stable }
test: { name: Testbench, flag: "--testbench" }
- platform: { name: Linux, distro: ubuntu-latest, toolchain: stable }
test: { name: UI, flag: "--ui" }
fallible: true
# Allow tests on nightly to fail.
- platform: { toolchain: nightly }
fallible: true
# Use the bigger 'C:/' from the "Switch Disk" step
- platform: { name: Windows }
working-directory:
"C:\\a\\${{ github.event.repository.name }}\\${{ github.event.repository.name }}"
steps:
- name: Checkout Sources
uses: actions/checkout@v4
- name: Free Disk Space (Linux)
if: matrix.platform.name == 'Linux'
run: |
echo "Freeing up disk space on Linux CI"
df -h
sudo rm -rf /usr/share/dotnet/
sudo rm -rf /opt/ghc
sudo rm -rf /usr/local/share/boost
sudo rm -rf /usr/local/graalvm/
sudo rm -rf /usr/local/.ghcup/
sudo rm -rf /usr/local/share/powershell
sudo rm -rf /usr/local/share/chromium
sudo rm -rf /usr/local/lib/android
sudo rm -rf /usr/local/lib/node_modules
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
sudo docker image prune --all --force
df -h
- name: Install Native Dependencies (macOS)
if: matrix.platform.name == 'macOS'
run: |
brew install mysql-client@8.4 libpq sqlite coreutils
brew link --force --overwrite mysql-client@8.4
brew link --force --overwrite libpq
echo "/usr/local/opt/mysql-client/bin" >> "$GITHUB_PATH"
# vcpkg --triplet x64-windows install libmysql libpq sqlite3 openssl
# + vcpkg/installed/vcpkg (in particular, the status file)
- name: Install Native Dependencies (Windows)
if: matrix.platform.name == 'Windows'
run: |
curl -fsLS -o vcpkg.7z https://blob.rocket.rs/vcpkg-2024-08-16.7z
7z x vcpkg.7z -y -bb0
xcopy .\vcpkg $env:VCPKG_INSTALLATION_ROOT /s /e /h /y /q
vcpkg integrate install
echo "VCPKGRS_DYNAMIC=1" >> "$env:GITHUB_ENV"
echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" >> "$env:GITHUB_ENV"
echo "$env:VCPKG_INSTALLATION_ROOT\installed\x64-windows\lib" >> "$env:GITHUB_PATH"
echo "MYSQLCLIENT_VERSION=8.0.39" >> "$env:GITHUB_ENV"
- name: Install NASM (Windows)
if: matrix.platform.name == 'Windows'
uses: ilammy/setup-nasm@v1
- name: Install Native Dependencies (Linux)
if: matrix.platform.name == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y libmysqlclient-dev libpq-dev libsqlite3-dev
- name: Install Rust
uses: dtolnay/rust-toolchain@master
id: toolchain
with:
toolchain: ${{ matrix.platform.toolchain }}
components: rust-src
- name: Cache Example Workspace
if: matrix.test.name == 'Examples'
uses: Swatinem/rust-cache@v2
with:
workspaces: examples
key: ${{ matrix.test.name }}-${{ steps.toolchain.outputs.cachekey }}
- name: Cache Root Workspace
if: matrix.test.name != 'Examples'
uses: Swatinem/rust-cache@v2
with:
key: ${{ matrix.test.name }}-${{ steps.toolchain.outputs.cachekey }}
# Don't run out of disk space on Windows. C: has much much space than D:.
- name: Switch Disk (Windows)
if: matrix.platform.name == 'Windows'
run: |
Get-PSDrive
cp D:\a C:\ -Recurse
Get-PSDrive
- name: Run Tests
continue-on-error: ${{ matrix.fallible || false }}
working-directory: ${{ matrix.working-directory || github.workspace }}
run: ./scripts/test.sh ${{ matrix.test.flag || '' }} -q
shell: bash
================================================
FILE: .github/workflows/trigger.yaml
================================================
name: Trigger
on: [push]
jobs:
trigger:
name: api.rocket.rs
runs-on: ubuntu-latest
if: github.repository == 'rwf2/Rocket'
steps:
- uses: actions/github-script@v7
with:
github-token: ${{ secrets.API_DOCS_DEPLOY_TOKEN }}
script: |
github.rest.actions.createWorkflowDispatch({
owner: 'rwf2',
repo: 'api.rocket.rs',
workflow_id: 'deploy.yaml',
ref: 'master'
})
================================================
FILE: .gitignore
================================================
# Compiled files
*.o
*.so
*.rlib
*.dll
# Executables
*.exe
# Generated by Cargo
target
# Generated databases
db.sqlite
db.sqlite-shm
db.sqlite-wal
# Remove Cargo.lock from gitignore if creating an executable, leave it for libraries
# More information here https://doc.rust-lang.org/cargo/guide/cargo-toml-vs-cargo-lock.html
Cargo.lock
# Cargo config directory
.cargo/
# The upload script, for now.
scripts/upload-docs.sh
scripts/redirect.html
# Backup files.
*.bak
# Uploads in pastebin example.
examples/pastebin/upload/*
================================================
FILE: .rustfmt.toml
================================================
disable_all_formatting = true
================================================
FILE: CHANGELOG.md
================================================
# Version 0.5.1 (May 22, 2024)
This release contains the following crate updates:
- `rocket` `0.5.1`
- `rocket_db_pools` `0.2.0`
- `rocket_dyn_templates` `0.2.0`
- `rocket_ws` `0.1.1`
## [`rocket`](https://api.rocket.rs/v0.5/rocket/) `0.5.1`
* The following `char` and `std::ops::Range` types now implement `FromForm`:
- `char`
- `Range<T: FromForm>` with `start` and `end` fields
- `RangeFrom<T: FromForm>` with `start` field
- `RangeTo<T: FromForm>` with `end` field
- `RangeToInclusive<T: FromForm>` with `end` field
* `[T; N]`, `Vec<T>`, and `[u8]` can now be passed to `uri!`.
* The guide now includes a [deploying section].
* The `FromForm` derive now properly records errors involving entire forms.
* `FromForm` derive can now be used in code emitted by `macro_rules!` macros.
* **(fix [#2668] via [52de9a])** [`TempFile`] now ensures it flushes before
being persisted.
## [`rocket_db_pools`](https://api.rocket.rs/v0.5/rocket_db_pools/) `0.2.0`
* SQLite extensions are now supported in `sqlx_sqlite`.
Use a database configuration option of `extensions` to specify extensions:
```toml
[default.databases.db_name]
url = "db.sqlite"
# This option is only supported by the `sqlx_sqlite` driver.
extensions = ["memvfs", "rot13"]
```
* (**breaking**) `deadpool` was updated to `0.13`.
* (**breaking**) The [`Config`](https://api.rocket.rs/v0.5/rocket_db_pools/struct.Config)
structure has a new `extensions` field.
## [`rocket_dyn_templates`](https://api.rocket.rs/v0.5/rocket_dyn_templates/) `0.2.0`
* Support for `minijinja` `2.0` templates was introduced.
Templates with an extension of `.j2` are recognized and rendered with
Minijinja.
* **(breaking)** `handlebars` was updated to `5.1`.
## [`rocket_ws`](https://api.rocket.rs/v0.5/rocket_ws/) `0.1.1`
* Introduced [`WebSocket::accept_key()`] method.
* `tungstenite` was updated to `0.21`.
## General Changes
* The `rust-version` for all crates was updated to `1.64`.
This reflects the correct MSRV required to build `rocket` `0.5.0`.
* License files are now present in all published crates.
[52de9a]: https://github.com/rwf2/Rocket/commit/52de9a
[#2668]: https://github.com/rwf2/Rocket/pull/2668
[deploying section]: https://rocket.rs/guide/v0.5/deploying/
[`WebSocket::accept_key()`]: https://api.rocket.rs/v0.5/rocket_ws/struct.WebSocket#method.accept_key
# Version 0.5.0 (Nov 17, 2023)
## Major Features and Improvements
This release introduces the following major features and improvements:
* Support for [compilation on Rust's stable] release channel.
* A rewritten, fully asynchronous core with support for [`async`/`await`].
* WebSocket support via [`rocket_ws`].
* [Feature-complete forms support] including multipart, collections, [ad-hoc validation], and
[context](https://rocket.rs/v0.5/guide/requests/#context).
* [Sentinels]: automatic verification of application state at start-up to prevent runtime errors.
* [Graceful shutdown] with configurable signaling, grace periods, [notification], and
[shutdown fairings].
* An entirely new, flexible and robust [configuration system] based on [Figment].
* Typed [asynchronous streams] and [Server-Sent Events] with generator syntax.
* Asynchronous database pooling support via [`rocket_db_pools`].
* Support for [mutual TLS] and client [`Certificate`]s.
* Automatic support for HTTP/2 including `h2` ALPN.
* Graduation of `json`, `msgpack`, and `uuid` `rocket_contrib` [features into core].
* An automatically enabled [`Shield`]: security and privacy headers for all responses.
* Type-system enforced [incoming data limits] to mitigate memory-based DoS attacks.
* Compile-time URI literals via a fully revamped [`uri!`] macro.
* [Request connection upgrade APIs] with support for raw I/O with the client.
* Full support for [UTF-8 characters] in routes and catchers.
* Precise detection of missing managed state, databases, and templating with [sentinels].
* Typed [build phases] with strict application-level guarantees.
* [Ignorable segments]: wildcard route matching with no typing restrictions.
* First-class [support for `serde`] for built-in guards and types.
* New application launch attributes:
[`#[launch]`](https://api.rocket.rs/v0.5/rocket/attr.launch.html) and
[`#[rocket::main]`](https://api.rocket.rs/v0.5/rocket/attr.main.html).
* [Default catchers] via `#[catch(default)]`, which handle _any_ status code.
* [Catcher scoping] to narrow the scope of a catcher to a URI prefix.
* Built-in libraries and support for [asynchronous testing].
* A [`TempFile`] data and form guard for automatic uploading to a temporary file.
* A [`Capped<T>`] data and form guard which enables detecting truncation due to data limits.
* Support for dynamic and static prefixing and suffixing of route URIs in [`uri!`].
* Support for custom config profiles and [automatic typed config extraction].
* Rewritten, zero-copy, RFC compliant URI parsers with support for URI-[`Reference`]s.
* Multi-segment parameters (`<param..>`) which match _zero_ segments.
* A [`local_cache!`] macro for request-local storage of non-uniquely typed values.
* A [`CookieJar`] without "one-at-a-time" limitations.
* [Singleton fairings] with replacement and guaranteed uniqueness.
* [Data limit declaration in SI units]: "2 MiB", `2.mebibytes()`.
* Optimistic responding even when data is left unread or limits are exceeded.
* Fully decoded borrowed strings as dynamic parameters, form and data guards.
* Borrowed byte slices as data and form guards.
* Fail-fast behavior for [misconfigured secrets], file serving paths.
* Support for generics and custom generic bounds in
[`#[derive(Responder)]`](https://api.rocket.rs/v0.5/rocket/derive.Responder.html).
* [Default ranking colors], which prevent more routing collisions automatically.
* Improved error logging with suggestions when common errors are detected.
* Completely rewritten examples including a new real-time [`chat`] application.
## Support for Rust Stable
As a result of support for Rust stable (Rust 2021 Edition and beyond),
`#![feature(..)]` crate attributes are no longer required to use Rocket. The
complete canonical example with a single `hello` route becomes:
```rust
#[macro_use] extern crate rocket;
#[get("/<name>/<age>")]
fn hello(name: &str, age: u8) -> String {
format!("Hello, {} year old named {}!", age, name)
}
#[launch]
fn rocket() -> _ {
rocket::build().mount("/hello", routes![hello])
}
```
<details>
<summary>See a <code>diff</code> of the changes from v0.4.</summary>
```diff
- #![feature(proc_macro_hygiene, decl_macro)]
-
#[macro_use] extern crate rocket;
#[get("/<name>/<age>")]
- fn hello(name: String, age: u8) -> String {
+ fn hello(name: &str, age: u8) -> String {
format!("Hello, {} year old named {}!", age, name)
}
- fn main() {
- rocket::ignite().mount("/hello", routes![hello]).launch();
- }
+ #[launch]
+ fn rocket() -> _ {
+ rocket::build().mount("/hello", routes![hello])
+ }
```
</details>
## Breaking Changes
This release includes many breaking changes. For a walkthrough guide on handling these changes, see
the [v0.4 to v0.5 migration guide]. The most significant changes are listed below.
### Silent Changes
These changes are invisible to the compiler and will _not_ yield errors or warnings at compile-time.
We **strongly** advise all application authors to review this list carefully.
* Blocking I/O (long running compute, synchronous `sleep()`, `Mutex`, `RwLock`, etc.) may prevent
the server from making progress and should be avoided, replaced with an `async` variant, or
performed in a worker thread. This is a consequence of Rust's cooperative `async` multitasking.
For details, see the new [multitasking] section of the guide.
* `ROCKET_ENV` is now `ROCKET_PROFILE`. A warning is emitted a launch time if the former is set.
* The default profile for debug builds is now `debug`, not `dev`.
* The default profile for release builds is now `release`, not `prod`.
* `ROCKET_LOG` is now `ROCKET_LOG_LEVEL`. A warning is emitted a launch time if the former is set.
* `ROCKET_ADDRESS` accepts only IP addresses, no longer resolves hostnames like `localhost`.
* `ROCKET_CLI_COLORS` accepts booleans `true`, `false` in place of strings `"on"`, `"off"`.
* It is a launch-time error if `secrets` is enabled in non-`debug` profiles without a configured
`secret_key`.
* A misconfigured `template_dir` is reported as an error at launch time.
* [`FileServer::new()`] fails immediately if the provided directory does not exist.
* Catcher collisions result in a launch failure as opposed to a warning.
* Default ranks now range from `-12` to `-1`. There is no breaking change if only code generated
routes are used. Manually configured routes with negative ranks may collide or be considered in
a different order than before.
* The order of execution of path and query guards relative to each other is now unspecified.
* URIs beginning with `:` are properly recognized as invalid and rejected.
* URI normalization now normalizes the query part as well.
* The `Segments` iterator now returns percent-decoded `&str`s.
* Forms are now parsed leniently by the [`Form` guard]. Use [`Strict`] for the previous behavior.
* The `Option<T>` form guard defaults to `None` instead of the default value for `T`.
* When data limits are exceeded, a `413 Payload Too Large` status is returned to the client.
* The default catcher now returns JSON when the client indicates preference via the `Accept`
header.
* Empty boolean form values parse as `true`: the query string `?f` is the same as `?f=true`.
* [`Created<R>`] does not automatically send an `ETag` header if `R: Hash`. Use
[`Created::tagged_body`] instead.
* `FileServer` now forwards when a file is not found instead of failing with `404 Not Found`.
* [`Shield`] is enabled by default. You may need to disable or change policies if your application
depends on typically insecure browser features or if you wish to opt-in to different policies
than the defaults.
* [`CookieJar`] `get()`s do not return cookies added during request handling. See
[`CookieJar`#pending].
* `Hash` `impl`s for `MediaType` and `ContentType` no longer consider media type parameters.
* When requested, the `FromForm` implementations of `Vec` and `Map`s are now properly lenient.
* To agree with browsers, the `[` and `]` characters are now accepted in URI paths.
* The `[` and `]` characters are no longer encoded by [`uri!`].
* The `Secure` cookie flag is set by default for all cookies when serving over TLS.
* Removal cookies have `SameSite` set to `Lax` by default.
* [`MediaType::JavaScript`] is now `text/javascript`.
### Contrib Graduation
The `rocket_contrib` crate is deprecated and the functionality moved to other `rocket` crates. The
[contrib deprecation upgrade guide] provides a walkthrough on migrating. The relevant changes are:
* Several features previously in `rocket_contrib` were merged into `rocket` itself:
- `json`, `msgpack`, and `uuid` are now [features of `rocket`].
- Moved `rocket_contrib::json` to [`rocket::serde::json`].
- Moved `rocket_contrib::msgpack` to [`rocket::serde::msgpack`].
- Moved `rocket_contrib::uuid` to [`rocket::serde::uuid`].
- Moved `rocket_contrib::helmet` to [`rocket::shield`]. [`Shield`] is enabled by default.
- Moved `rocket_contrib::serve` to [`rocket::fs`], `StaticFiles` to [`rocket::fs::FileServer`].
- Removed the now unnecessary `Uuid` and `JsonValue` wrapper types.
- Removed headers in `Shield` that are no longer respected by browsers.
* The remaining features from `rocket_contrib` are now provided by separate crates:
- Replaced `rocket_contrib::templates` with [`rocket_dyn_templates`].
- Replaced `rocket_contrib::databases` with [`rocket_sync_db_pools`] and [`rocket_db_pools`].
- These crates are versioned and released independently of `rocket`.
- `rocket_contrib::databases::DbError` is now `rocket_sync_db_pools::Error`.
- Removed `redis`, `mongodb`, and `mysql` integrations which have upstream `async` drivers.
- The [`#[database]`](https://api.rocket.rs/v0.5/rocket_sync_db_pools/attr.database.html)
attribute generates an [`async run()`] method instead of `Deref` implementations.
### General
The following breaking changes apply broadly and are likely to cause compile-time errors.
* [`Rocket`] is now generic over a [phase] marker:
- APIs operate on `Rocket<Build>`, `Rocket<Ignite>`, `Rocket<Orbit>`, or `Rocket<P: Phase>` as
needed.
- The phase marker statically enforces state transitions in `Build`, `Ignite`, `Orbit` order.
- `rocket::ignite()` is now [`rocket::build()`] and returns a `Rocket<Build>`.
- [`Rocket::ignite()`] transitions to the `Ignite` phase. This is run automatically on launch as
needed.
- Ignition finalizes configuration, runs `ignite` fairings, and verifies [sentinels].
- [`Rocket::launch()`] transitions into the `Orbit` phase and starts the server.
- Methods like [`Request::rocket()`] that refer to a live Rocket instance return an
`&Rocket<Orbit>`.
* [Fairings] have been reorganized and restructured for `async`:
- Replaced `attach` fairings with `ignite` fairings. Unlike `attach` fairings, which ran
immediately at the time of attachment, `ignite` fairings are run when transitioning into the
`Ignite` phase.
- Replaced `launch` fairings with `liftoff` fairings. `liftoff` fairings are always run, even in
local clients, after the server begins listening and the concrete port is known.
* Introduced a new [configuration system] based on [Figment]:
- The concept of "environments" is replaced with "profiles".
- `ROCKET_ENV` is superseded by `ROCKET_PROFILE`.
- `ROCKET_LOG` is superseded by `ROCKET_LOG_LEVEL`.
- Profile names can now be arbitrarily chosen. The `dev`, `stage`, and `prod` profiles carry no
special meaning.
- The `debug` and `release` profiles are the default profiles for the debug and release
compilation profiles.
- A new specially recognized `default` profile specifies defaults for all profiles.
- The `global` profile has highest precedence, followed by the selected profile, followed by
`default`.
- Added support for limits specified in SI units: "1 MiB".
- Renamed `LoggingLevel` to [`LogLevel`].
- Inlined error variants into the [`Error`] structure.
- Changed the type of `workers` to `usize` from `u16`.
- Changed accepted values for `keep_alive`: it is disabled with `0`, not `false` or `off`.
- Disabled the `secrets` feature (for private cookies) by default.
- Removed APIs related to "extras". Typed values can be extracted from the configured `Figment`.
- Removed `ConfigBuilder`: all fields of [`Config`] are public with constructors for each field
type.
* Many functions, traits, and trait bounds have been modified for `async`:
- [`FromRequest`], [`Fairing`], [`catcher::Handler`], [`route::Handler`], and [`FromData`] use
`#[async_trait]`.
- [`NamedFile::open`] is now an `async` function.
- Added [`Request::local_cache_async()`] for use in async request guards.
- Unsized `Response` bodies must be [`AsyncRead`] instead of `Read`.
- Automatically sized `Response` bodies must be [`AsyncSeek`] instead of `Seek`.
- The `local` module is split into two: [`rocket::local::asynchronous`] and
[`rocket::local::blocking`].
* Functionality and features requiring Rust nightly were removed:
- Removed the `Try` implementation on [`Outcome`] which allowed using `?` with `Outcome`s. The
recommended replacement is the [`rocket::outcome::try_outcome!`] macro or the various
combinator functions on `Outcome`.
- [`Result<T, E>` implements `Responder`] only when both `T` and `E` implement `Responder`. The
new [`Debug`] wrapping responder replaces `Result<T: Responder, E: Debug>`.
- APIs which used the `!` type to now use [`std::convert::Infallible`].
* [`IntoOutcome`] was overhauled to supplant methods now removed in `Outcome`.
- `IntoOutcome::into_outcome()` is now `or_error()`.
- `IntoOutcome` is implemented for all `Outcome` type aliases.
- `Outcome::forward()` requires specifying a status code.
- `Outcome::from()` and `Outcome::from_or_forward()` were removed.
* [`Rocket::register()`] now takes a base path to scope catchers under as its first argument.
* `ErrorKind::Collision` has been renamed to [`ErrorKind::Collisions`].
* TLS config values are only available when the `tls` feature is enabled.
* [`MediaType::with_params()`] and [`ContentType::with_params()`] are now builder methods.
* Content-Type [`content`] responder type names are now prefixed with `Raw`.
* The `content::Plain` responder is now called `content::RawText`.
* The `content::Custom<T>` responder was removed in favor of [`(ContentType, T)`].
* Removed `CookieJar::get_private_pending()` in favor of [`CookieJar::get_pending()`].
* The [`local_cache!`] macro accepts fewer types. Use [`local_cache_once!`] as appropriate.
* [`Rocket::launch()`] allows `Rocket` recovery by returning the instance after shutdown.
* `ErrorKind::Runtime` was removed; [`ErrorKind::Shutdown`] was added.
* `Outcome::Failure` was renamed to [`Outcome::Error`].
### Routing and URIs
* In `#[route(GET, path = "...")]`, `path` is now `uri`: `#[route(GET, uri = "...")]`.
* Multi-segment paths (`/<p..>`) now match _zero_ or more segments.
* Codegen improvements preclude identically named routes and modules in the same namespace.
* A route URI like (`/<a>/<p..>`) now collides with (`/<a>`), requires a `rank` to resolve.
* All catcher related types and traits moved to [`rocket::catcher`].
* All route related types and traits moved to [`rocket::route`].
* URI formatting types and traits moved to [`rocket::http::uri::fmt`].
* `T` no longer converts to `Option<T>` or `Result<T, _>` for [`uri!`] query parameters.
* For optional query parameters, [`uri!`] requires using a wrapped value or `_`.
* `&RawStr` no longer implements `FromParam`: use `&str` instead.
* Percent-decoding is performed before calling `FromParam` implementations.
* `RawStr::url_decode()` and `RawStr::url_decode_lossy()` allocate as necessary, return `Cow`.
* `RawStr::from_str()` was replaced with `RawStr::new()`.
* `Origin::segments()` was replaced with `Origin.path().segments()`.
* `Origin::path()` and `Origin::query()` return `&RawStr` instead of `&str`.
* The type of `Route::name` is now `Option<Cow<'static, str>>`.
* `Route::set_uri` was replaced with [`Route::map_base()`].
* The `Route::uri` field is now of type [`RouteUri`].
* `Route::base` was removed in favor of `Route.uri().base()`.
* [Route `Forward` outcomes] are now associated with a `Status`.
* The status codes used when built-in guards forward were changed:
- Route parameter `FromParam` errors now forward as 422.
- Query parameter errors now forward as 422.
- Incorrect form content-type errors forwards as 413.
- `&Host`, `&Accept`, `&ContentType`, `IpAddr`, and `SocketAddr` all forward
with a 500.
### Data and Forms
* `Data` now has a lifetime generic: `Data<'r>`.
* [`Data::open()`] indelibly requires a data limit.
* Removed `FromDataSimple`. Use [`FromData`] and [`local_cache!`] or [`local_cache_once!`].
* All [`DataStream`] APIs require limits and return [`Capped<T>`] types.
* Form types and traits were moved from `rocket::request` to [`rocket::form`].
* Removed `FromQuery`. Dynamic query parameters (`#[get("/?<param>")]`) use [`FromForm`] instead.
* Replaced `FromFormValue` with [`FromFormField`]. All `T: FromFormField` implement `FromForm`.
* Form field values are percent-decoded before calling [`FromFormField`] implementations.
* Renamed the `#[form(field = ...)]` attribute to `#[field(name = ...)]`.
* [Custom form errors] must now specify an associated `Status`.
### Request Guards
* Renamed `Cookies` to [`CookieJar`]. Its methods take `&self`.
* Renamed `Flash.name` to `Flash.kind`, `Flash.msg` to `Flash.message`.
* Replaced `Request::get_param()` with `Request::param()`.
* Replaced `Request::get_segments()` to `Request::segments()`.
* Replaced `Request::get_query_value()` with `Request::query_value()`.
* Replaced `Segments::into_path_buf()` with `Segments::to_path_buf()`.
* Replaced `Segments` and `QuerySegments` with [`Segments<Path>` and `Segments<Query>`].
* [`Flash`] constructors now take `Into<String>` instead of `AsRef<str>`.
* The `State<'_, T>` request guard is now `&State<T>`.
* Removed a lifetime from [`FromRequest`]: `FromRequest<'r>`.
* Removed a lifetime from [`FlashMessage`]: `FlashMessage<'_>`.
* Removed all `State` reexports except [`rocket::State`].
### Responders
* Moved `NamedFile` to `rocket::fs::NamedFile`
* Replaced `Content` with `content::Custom`.
* `Response::body` and `Response::body_mut` are now infallible methods.
* Renamed `ResponseBuilder` to `Builder`.
* Removed direct `Response` body reading methods. Use methods on `r.body_mut()` instead.
* Removed inaccurate "chunked body" types and variants.
* Removed `Responder` `impl` for `Response`. Prefer custom responders with `#[derive(Responder)]`.
* Removed the unused reason phrase from `Status`.
* The types of responders in [`response::status`] were unified to all be of
the form `Status<R>(R)`.
## General Improvements
In addition to new features and changes, Rocket saw the following improvements:
### General
* Added support for [raw identifiers] in the `FromForm` derive, `#[route]` macros, and `uri!`.
* Added support for uncased derived form fields: `#[field(name = uncased(...))]`.
* Added support for [default form field values]: `#[field(default = expr())]`.
* Added support for multiple `#[field]` attributes on struct fields.
* Added support for base16-encoded (a.k.a. hex-encoded) secret keys.
* Added [`Config::ident`] for configuring or removing the global `Server` header.
* Added [`Rocket::figment()`] and [`Rocket::catchers()`].
* Added [`LocalRequest::json()`] and [`LocalResponse::json()`].
* Added [`LocalRequest::msgpack()`] and [`LocalResponse::msgpack()`].
* Added support for `use m::route; routes![route]` instead of needing `routes![m::route]`.
* Added support for [hierarchical data limits]: a limit of `a/b/c` falls back to `a/b` then `a`.
* Added [`LocalRequest::inner_mut()`]. `LocalRequest` implements `DerefMut` to `Request`.
* Added support for ECDSA and EdDSA TLS keys.
* Added associated constants in `Config` for all config parameter names.
* Added `ErrorKind::Config` to represent errors in configuration at runtime.
* Added `rocket::fairing::Result` type alias, returned by `Fairing::on_ignite()`.
* All guard failures are logged at runtime.
* `Rocket::mount()` now accepts a base value of any type that implements `TryInto<Origin<'_>>`.
* The default error catcher's HTML has been compacted.
* The default error catcher returns JSON if requested by the client.
* Panics in routes or catchers are caught and forwarded to `500` error catcher.
* A detailed warning is emitted if a route or catcher panics.
* Emoji characters are no longer output on Windows.
* Fixed [`Error`] to not panic if a panic is already in progress.
* Introduced [`Reference`] and [`Asterisk`] URI types.
* Added support to [`UriDisplayQuery`] for C-like enums.
* The [`UriDisplayQuery`] derive now recognizes the `#[field]` attribute for field renaming.
* `Client` method builders accept `TryInto<Origin>` allowing a `uri!()` to be used directly.
* [`Rocket`] is now `#[must_use]`.
* Support for HTTP/2 can be disabled by disabling the default `http2` crate feature.
* Added [`rocket::execute()`] for executing Rocket's `launch()` future.
* Added the [`context!`] macro to [`rocket_dyn_templates`] for ad-hoc template contexts.
* The `time` crate is re-exported from the crate root.
* The `FromForm`, `Responder`, and `UriDisplay` derives now fully support generics.
* Added helper functions to `serde` submodules.
* The [`Shield`] HSTS preload header now includes `includeSubdomains`.
* Logging ignores `write!` errors if `stdout` disappears, preventing panics.
* Added [`Client::terminate()`] to run graceful shutdown in testing.
* Shutdown now terminates the `async` runtime, never the process.
* Added a [`local_cache_once!`] macro for request-local storage.
* Final launch messages are now _always_ logged, irrespective of profile.
* Only functions that return `Rocket<Build>` are now `#[must_use]`, not all `Rocket<P>`.
* Fixed mismatched form field names in errors under certain conditions in [`FromForm`] derive.
* The [`FromForm`] derive now collects _all_ errors that occur.
* Data pools are now gracefully shutdown in [`rocket_sync_db_pools`].
* Added [`Metadata::render()`] in [`rocket_dyn_templates`] for direct template rendering.
* Rocket salvages more information from malformed requests for error catchers.
* The `cookie` `secure` feature is now properly conditionally enabled.
* Data before encapsulation boundaries in TLS keys is allowed and ignored.
* Support for TLS keys in SEC1 format was added.
* Rocket now warns when a known secret key is configured.
* A panic that could occur on shutdown in `rocket_sync_db_pools` was fixed.
* Added a [`max_blocking`] configuration parameter to control number of blocking threads.
* Added an [`ip_header`] "real IP" header configuration parameter.
* A [`pool()`] method is emitted by [`rocket_sync_db_pools`] for code-generated pools.
* Data guards are now eligible [sentinels].
* Raw binary form field data can be retrieved using the `&[u8]` form guard.
* Added [`TempFile::open()`] to stream `TempFile` data.
* mTLS certificates can be set on local requests with [`LocalRequest::identity()`].
* Added [`Error::pretty_print()`] for pretty-printing errors like Rocket.
* Warnings are logged when data limits are reached.
* A warning is emitted when `String` is used as a route parameter.
* Configuration provenance information is logged under the `debug` log level.
* Logging of `Outcome`s now includes the relevant status code.
* `Span::mixed_site()` is used in codegen to reduce errant `clippy` warnings.
### HTTP
* Added support for HTTP/2, enabled by default via the `http2` crate feature.
* Added a `const` constructor for `MediaType`.
* Introduced [`RawStrBuf`], an owned `RawStr`.
* Added many new "pattern" methods to [`RawStr`].
* Added [`RawStr::percent_encode()`] and [`RawStr::strip()`].
* Added support for unencoded query characters in URIs that are frequently sent by browsers.
* Introduced [`Host`] and [`&Host`] request guards.
* Added [`RawStr::percent_encode_bytes()`].
* `NODELAY` is now enabled on all connections by default.
* The TLS implementation handles handshakes off the main task, improving DoS resistance.
### Known Media Types
* Added AVIF: `image/avif`.
* Added `EventStream`: `text/event-stream`.
* Added `Markdown`: `text/markdown`.
* Added `MP3`: `audio/mpeg`.
* Added `CBZ`: `application/vnd.comicbook+zip`, extension `.cbz`.
* Added `CBR`: `application/vnd.comicbook-rar`, extension `.cbr`.
* Added `RAR`: `application/vnd.rar`, extension `.rar`.
* Added `EPUB`: `application/epub+zip`, extension `.epub`.
* Added `OPF`: `application/oebps-package+xml`, extension `.opf`.
* Added `XHTML`: `application/xhtml+xml`, extension `.xhtml`.
* Added `Text` as an alias for the `Plain` media type.
* Added `Bytes` as an alias for the `Binary` media type.
* Added `.mjs` as known JavaScript extension.
* Added '.exe', '.iso', '.dmg' as known extensions.
### Request
* Added support for all UTF-8 characters in route paths.
* Added support for percent-encoded `:` in socket or IP address values in [`FromFormValue`].
* Added [`Request::rocket()`] to access the active `Rocket` instance.
* `Request::uri()` now returns an `&Origin<'r>` instead of `&Origin<'_>`.
* `Request::accept()`, `Request::content_type()` reflect changes to `Accept`, `Content-Type`.
* `Json<T>`, `MsgPack<T>` accept `T: Deserialize`, not only `T: DeserializeOwned`.
* Diesel SQLite connections in `rocket_sync_db_pools` use better defaults.
* The default number of workers for synchronous database pools is now `workers * 4`.
* Added [`Request::host()`] to retrieve the client-requested host.
### Response
* Added [`Template::try_custom()`] for fallible template engine customization.
* Manually registered templates can now be rendered with `Template::render()`.
* Added support for the `X-DNS-Prefetch-Control` header to `Shield`.
* Added support for manually-set `expires` values for private cookies.
* Added support for type generics and custom generic bounds to
[`#[derive(Responder)]`](https://api.rocket.rs/v0.5/rocket/derive.Responder.html).
* The `Server` header is only set if one isn't already set.
* Accurate `Content-Length` headers are sent even for partially read `Body`s.
* [`Redirect`] now accepts a `TryFrom<Reference>`, allowing fragment parts.
### Trait Implementations
* Implemented `Clone` for `State`.
* Implemented `Copy` and `Clone` for `fairing::Info`.
* Implemented `Debug` for `Rocket` and `Client`.
* Implemented `Default` for `Status` (returns `Status::Ok`).
* Implemented `PartialEq`, `Eq`, `Hash`, `PartialOrd`, and `Ord` for `Status`.
* Implemented `Eq`, `Hash`, and `PartialEq<&str>` for `Origin`.
* Implemented `PartialEq<Cow<'_, RawStr>>>` for `RawStr`.
* Implemented `std::error::Error` for `Error`.
* Implemented `Deref` and `DerefMut` for `LocalRequest` (to `Request`).
* Implemented `DerefMut` for `Form`, `LenientForm`.
* Implemented `From<T>` for `Json<T>`, `MsgPack<T>`.
* Implemented `TryFrom<String>` and `TryFrom<&str>` for `Origin`.
* Implemented `TryFrom<Uri>` for each of the specific URI variants.
* Implemented `FromRequest` for `&Config`.
* Implemented `FromRequest` for `IpAddr`.
* Implemented `FromParam` for `PathBuf`
* Implemented `FromParam`, `FromData`, and `FromForm` for `&str`.
* Implemented `FromForm` for `Json<T>`, `MsgPack<T>`.
* Implemented `FromFormField` for `Cow` and `Capped<Cow>>`
* Implemented `Responder` for `tokio::fs::File`.
* Implemented `Responder` for `(ContentType, R) where R: Responder`.
* Implemented `Responder` for `(Status, R) where R: Responder` which overrides `R`'s status.
* Implemented `Responder` for `std::io::Error` (behaves as `Debug<std::io::Error>`).
* Implemented `Responder` for `Either<T, E>`, equivalently to `Result<T, E>`.
* Implemented `Serialize` for `Flash`.
* Implemented `Serialize`, `Deserialize`, `UriDisplay` and `FromUriParam` for `uuid::Uuid`
* Implemented `Serialize`, `Deserialize` for `RawStr`.
* Implemented `Serialize`, `Deserialize` for all URI types.
* Implemented `Responder` for `Arc<T>`, `Box<T>` where `T: Responder`.
* Implemented `Serialize` and `Deserialize` for [`Method`].
* Implemented `Eq` for [`MediaType`] and [`ContentType`].
* Implemented `Responder` for `Box<T: Responder + Sized>`.
* Implemented `FromForm` for `Arc<T>`.
* Implemented `Fairing` for `Arc<dyn Fairing>`.
* Implemented `Serialize` and `Deserialize` for `Status`.
### Dependency Changes
* `serde` was introduced (`1.0`).
* `futures` was introduced (`0.3`).
* `binascii` was introduced (`0.1`).
* `ref-cast` was introduced (`1.0`).
* `atomic` was introduced (`0.5`).
* `parking_lot` was introduced (`0.11`).
* `ubtye` was introduced (`0.10`).
* `figment` was introduced (`0.10`).
* `rand` was introduced (`0.8`).
* `either` was introduced (`1.0`).
* `pin-project-lite` was introduced (`0.2`).
* `indexmap` was introduced (`2.0`).
* `tempfile` was introduced (`3.0`).
* `async-trait` was introduced (`0.1`).
* `async-stream` was introduced (`0.3`).
* `multer` was introduced (`2.0`).
* `tokio` was introduced (`1.6.1`).
* `tokio-util` was introduced (`0.6`).
* `tokio-stream` was introduced (`0.1.6`).
* `bytes` was introduced (`1.0`).
* `normpath` was introduced (`1`).
* `state` was updated to `0.6`.
* `rmp-serde` was updated to `0.15`.
* `uuid` was updated to `0.8`.
* `tera` was updated to `1.10`.
* `postgres` was updated to `0.19`.
* `rusqlite` was updated to `0.25`.
* `r2d2_sqlite` was updated to `0.18`.
* `time` was updated to `0.3`.
* `handlebars` was updated to `4.0`.
* `memcache` was updated to `0.16`.
* `rustls` was updated to `0.21`.
* `tokio-rustls` was updated to `0.24`.
* `syn` was updated to `2`.
* `diesel` was updated to `2.0`.
* `sqlx` was updated to `0.7`.
* `notify` was updated to `6`.
* `criterion` was updated to `0.4`.
* `cookie` was updated to `0.18`.
* `yansi` was updated to `1.0`.
* `atty` was removed.
## Infrastructure
The following changes were made to the project's infrastructure:
* Rocket now uses the 2021 edition of Rust.
* Added a [v0.4 to v0.5 migration guide] and [FAQ] to Rocket's website.
* Added visible `use` statements to examples in the guide.
* Split examples into a separate workspace for easier testing.
* Updated documentation for all changes.
* Fixed many typos, errors, and broken links throughout documentation and examples.
* Improved the general robustness of macros, and the quality and frequency of error messages.
* Benchmarks now use `criterion` and datasets extracted from real-world projects.
* Fixed the SPDX license expressions in `Cargo.toml` files.
* Added support to `test.sh` for a `+` flag (e.g. `+stable`) to pass to `cargo`.
* Added support to `test.sh` for extra flags to be passed on to `cargo`.
* UI tests are now allowed to fail by the CI to avoid false negatives.
* The GitHub CI workflow was updated to use maintained actions.
* The CI now frees disk space before proceeding to avoid out-of-disk errors.
* All workspaces now use `resolver = 2`.
[phase]: https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#phases
[`async`/`await`]: https://rocket.rs/v0.5/guide/overview/#async-routes
[compilation on Rust's stable]: https://rocket.rs/v0.5/guide/getting-started/#installing-rust
[Feature-complete forms support]: https://rocket.rs/v0.5/guide/requests/#forms
[configuration system]: https://rocket.rs/v0.5/guide/configuration/#configuration
[graceful shutdown]: https://api.rocket.rs/v0.5/rocket/config/struct.Shutdown.html#summary
[asynchronous testing]: https://rocket.rs/v0.5/guide/testing/#asynchronous-testing
[UTF-8 characters]: https://rocket.rs/v0.5/guide/requests/#static-parameters
[ignorable segments]: https://rocket.rs/v0.5/guide/requests/#ignored-segments
[Catcher scoping]: https://rocket.rs/v0.5/guide/requests/#scoping
[ad-hoc validation]: https://rocket.rs/v0.5/guide/requests#ad-hoc-validation
[incoming data limits]: https://rocket.rs/v0.5/guide/requests/#streaming
[build phases]: https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#phases
[Singleton fairings]: https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html#singletons
[features into core]: https://api.rocket.rs/v0.5/rocket/index.html#features
[features of `rocket`]: https://api.rocket.rs/v0.5/rocket/index.html#features
[Data limit declaration in SI units]: https://api.rocket.rs/v0.5/rocket/data/struct.ByteUnit.html
[support for `serde`]: https://api.rocket.rs/v0.5/rocket/serde/index.html
[automatic typed config extraction]: https://api.rocket.rs/v0.5/rocket/fairing/struct.AdHoc.html#method.config
[misconfigured secrets]: https://api.rocket.rs/v0.5/rocket/config/struct.SecretKey.html
[default ranking colors]: https://rocket.rs/v0.5/guide/requests/#default-ranking
[`chat`]: https://github.com/rwf2/Rocket/tree/v0.5/examples/chat
[`Form` guard]: https://api.rocket.rs/v0.5/rocket/form/struct.Form.html
[`Strict`]: https://api.rocket.rs/v0.5/rocket/form/struct.Strict.html
[`CookieJar`#pending]: https://api.rocket.rs/v0.5/rocket/http/struct.CookieJar.html#pending
[`rocket::serde::json`]: https://api.rocket.rs/v0.5/rocket/serde/json/index.html
[`rocket::serde::msgpack`]: https://api.rocket.rs/v0.5/rocket/serde/msgpack/index.html
[`rocket::serde::uuid`]: https://api.rocket.rs/v0.5/rocket/serde/uuid/index.html
[`rocket::shield`]: https://api.rocket.rs/v0.5/rocket/shield/index.html
[`rocket::fs`]: https://api.rocket.rs/v0.5/rocket/fs/index.html
[`async run()`]: https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html#handlers
[`LocalRequest::json()`]: https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalRequest.html#method.json
[`LocalRequest::msgpack()`]: https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalRequest.html#method.msgpack
[`LocalResponse::json()`]: https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalResponse.html#method.json
[`LocalResponse::msgpack()`]: https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalResponse.html#method.msgpack
[hierarchical data limits]: https://api.rocket.rs/v0.5/rocket/data/struct.Limits.html#hierarchy
[default form field values]: https://rocket.rs/v0.5/guide/requests/#defaults
[`Config::ident`]: https://api.rocket.rs/rocket/struct.Config.html#structfield.ident
[`tokio`]: https://tokio.rs/
[Figment]: https://docs.rs/figment/0.10/figment/
[`TempFile`]: https://api.rocket.rs/v0.5/rocket/fs/enum.TempFile.html
[`Contextual`]: https://rocket.rs/v0.5/guide/requests/#context
[`Capped<T>`]: https://api.rocket.rs/v0.5/rocket/data/struct.Capped.html
[default catchers]: https://rocket.rs/v0.5/guide/requests/#default-catchers
[URI types]: https://api.rocket.rs/v0.5/rocket/http/uri/index.html
[`uri!`]: https://api.rocket.rs/v0.5/rocket/macro.uri.html
[`Reference`]: https://api.rocket.rs/v0.5/rocket/http/uri/struct.Reference.html
[`Asterisk`]: https://api.rocket.rs/v0.5/rocket/http/uri/struct.Asterisk.html
[`Redirect`]: https://api.rocket.rs/v0.5/rocket/response/struct.Redirect.html
[`UriDisplayQuery`]: https://api.rocket.rs/v0.5/rocket/derive.UriDisplayQuery.html
[`Shield`]: https://api.rocket.rs/v0.5/rocket/shield/struct.Shield.html
[Sentinels]: https://api.rocket.rs/v0.5/rocket/trait.Sentinel.html
[`local_cache!`]: https://api.rocket.rs/v0.5/rocket/request/macro.local_cache.html
[`local_cache_once!`]: https://api.rocket.rs/v0.5/rocket/request/macro.local_cache_once.html
[`CookieJar`]: https://api.rocket.rs/v0.5/rocket/http/struct.CookieJar.html
[asynchronous streams]: https://rocket.rs/v0.5/guide/responses/#async-streams
[Server-Sent Events]: https://api.rocket.rs/v0.5/rocket/response/stream/struct.EventStream.html
[`fs::relative!`]: https://api.rocket.rs/v0.5/rocket/fs/macro.relative.html
[notification]: https://api.rocket.rs/v0.5/rocket/struct.Shutdown.html
[`Rocket`]: https://api.rocket.rs/v0.5/rocket/struct.Rocket.html
[`rocket::build()`]: https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.build
[`Rocket::ignite()`]: https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.ignite
[`Rocket::launch()`]: https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.launch
[`Request::rocket()`]: https://api.rocket.rs/v0.5/rocket/request/struct.Request.html#method.rocket
[Fairings]: https://rocket.rs/v0.5/guide/fairings/
[configuration system]: https://rocket.rs/v0.5/guide/configuration/
[`Poolable`]: https://api.rocket.rs/v0.5/rocket_sync_db_pools/trait.Poolable.html
[`Config`]: https://api.rocket.rs/v0.5/rocket/struct.Config.html
[`Error`]: https://api.rocket.rs/v0.5/rocket/struct.Error.html
[`LogLevel`]: https://api.rocket.rs/v0.5/rocket/config/enum.LogLevel.html
[`Rocket::register()`]: https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.register
[`NamedFile::open`]: https://api.rocket.rs/v0.5/rocket/fs/struct.NamedFile.html#method.open
[`Request::local_cache_async()`]: https://api.rocket.rs/v0.5/rocket/request/struct.Request.html#method.local_cache_async
[`FromRequest`]: https://api.rocket.rs/v0.5/rocket/request/trait.FromRequest.html
[`Fairing`]: https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html
[`catcher::Handler`]: https://api.rocket.rs/v0.5/rocket/catcher/trait.Handler.html
[`route::Handler`]: https://api.rocket.rs/v0.5/rocket/route/trait.Handler.html
[`FromData`]: https://api.rocket.rs/v0.5/rocket/data/trait.FromData.html
[`AsyncRead`]: https://docs.rs/tokio/1/tokio/io/trait.AsyncRead.html
[`AsyncSeek`]: https://docs.rs/tokio/1/tokio/io/trait.AsyncSeek.html
[`rocket::local::asynchronous`]: https://api.rocket.rs/v0.5/rocket/local/asynchronous/index.html
[`rocket::local::blocking`]: https://api.rocket.rs/v0.5/rocket/local/blocking/index.html
[`Outcome`]: https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html
[`rocket::outcome::try_outcome!`]: https://api.rocket.rs/v0.5/rocket/outcome/macro.try_outcome.html
[`Result<T, E>` implements `Responder`]: https://api.rocket.rs/v0.5/rocket/response/trait.Responder.html#provided-implementations
[`Debug`]: https://api.rocket.rs/v0.5/rocket/response/struct.Debug.html
[`std::convert::Infallible`]: https://doc.rust-lang.org/stable/std/convert/enum.Infallible.html
[`ErrorKind::Collisions`]: https://api.rocket.rs/v0.5/rocket/error/enum.ErrorKind.html#variant.Collisions
[`rocket::http::uri::fmt`]: https://api.rocket.rs/v0.5/rocket/http/uri/fmt/index.html
[`Data::open()`]: https://api.rocket.rs/v0.5/rocket/data/struct.Data.html#method.open
[`DataStream`]: https://api.rocket.rs/v0.5/rocket/data/struct.DataStream.html
[`rocket::form`]: https://api.rocket.rs/v0.5/rocket/form/index.html
[`FromFormField`]: https://api.rocket.rs/v0.5/rocket/form/trait.FromFormField.html
[`FromForm`]: https://api.rocket.rs/v0.5/rocket/form/trait.FromForm.html
[`FlashMessage`]: https://api.rocket.rs/v0.5/rocket/request/type.FlashMessage.html
[`Flash`]: https://api.rocket.rs/v0.5/rocket/response/struct.Flash.html
[`rocket::State`]: https://api.rocket.rs/v0.5/rocket/struct.State.html
[`Segments<Path>` and `Segments<Query>`]: https://api.rocket.rs/v0.5/rocket/http/uri/struct.Segments.html
[`Route::map_base()`]: https://api.rocket.rs/v0.5/rocket/route/struct.Route.html#method.map_base
[`uuid` support]: https://api.rocket.rs/v0.5/rocket/serde/uuid/index.html
[`json`]: https://api.rocket.rs/v0.5/rocket/serde/json/index.html
[`msgpack`]: https://api.rocket.rs/v0.5/rocket/serde/msgpack/index.html
[`rocket::serde::json::json!`]: https://api.rocket.rs/v0.5/rocket/serde/json/macro.json.html
[`rocket::shield::Shield`]: https://api.rocket.rs/v0.5/rocket/shield/struct.Shield.html
[`rocket::fs::FileServer`]: https://api.rocket.rs/v0.5/rocket/fs/struct.FileServer.html
[`rocket_dyn_templates`]: https://api.rocket.rs/v0.5/rocket_dyn_templates/index.html
[`rocket_sync_db_pools`]: https://api.rocket.rs/v0.5/rocket_sync_db_pools/index.html
[multitasking]: https://rocket.rs/v0.5/guide/overview/#multitasking
[`Created<R>`]: https://api.rocket.rs/v0.5/rocket/response/status/struct.Created.html
[`Created::tagged_body`]: https://api.rocket.rs/v0.5/rocket/response/status/struct.Created.html#method.tagged_body
[raw identifiers]: https://doc.rust-lang.org/1.51.0/book/appendix-01-keywords.html#raw-identifiers
[`Rocket::config()`]: https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.config
[`Rocket::figment()`]: https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.figment
[`Rocket::state()`]: https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.state
[`Rocket::catchers()`]: https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.catchers
[`LocalRequest::inner_mut()`]: https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalRequest.html#method.inner_mut
[`RawStrBuf`]: https://api.rocket.rs/v0.5/rocket/http/struct.RawStrBuf.html
[`RawStr`]: https://api.rocket.rs/v0.5/rocket/http/struct.RawStr.html
[`RawStr::percent_encode()`]: https://api.rocket.rs/v0.5/rocket/http/struct.RawStr.html#method.percent_encode
[`RawStr::percent_encode_bytes()`]: https://api.rocket.rs/v0.5/rocket/http/struct.RawStr.html#method.percent_encode_bytes
[`RawStr::strip()`]: https://api.rocket.rs/v0.5/rocket/http/struct.RawStr.html#method.strip_prefix
[`rocket::catcher`]: https://api.rocket.rs/v0.5/rocket/catcher/index.html
[`rocket::route`]: https://api.rocket.rs/v0.5/rocket/route/index.html
[`Segments::prefix_of()`]: https://api.rocket.rs/v0.5/rocket/http/uri/struct.Segments.html#method.prefix_of
[`Template::try_custom()`]: https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html#method.try_custom
[`Template::custom`]: https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Template.html#method.custom
[`FileServer::new()`]: https://api.rocket.rs/v0.5/rocket/fs/struct.FileServer.html#method.new
[`content`]: https://api.rocket.rs/v0.5/rocket/response/content/index.html
[`rocket_db_pools`]: https://api.rocket.rs/v0.5/rocket_db_pools/index.html
[mutual TLS]: https://rocket.rs/v0.5/guide/configuration/#mutual-tls
[`Certificate`]: https://api.rocket.rs/v0.5/rocket/mtls/struct.Certificate.html
[`MediaType::with_params()`]: https://api.rocket.rs/v0.5/rocket/http/struct.MediaType.html#method.with_params
[`ContentType::with_params()`]: https://api.rocket.rs/v0.5/rocket/http/struct.ContentType.html#method.with_params
[`Host`]: https://api.rocket.rs/v0.5/rocket/http/uri/struct.Host.html
[`&Host`]: https://api.rocket.rs/v0.5/rocket/http/uri/struct.Host.html
[`Request::host()`]: https://api.rocket.rs/v0.5/rocket/request/struct.Request.html#method.host
[`context!`]: https://api.rocket.rs/v0.5/rocket_dyn_templates/macro.context.html
[`MediaType`]: https://api.rocket.rs/v0.5/rocket/http/struct.MediaType.html
[`ContentType`]: https://api.rocket.rs/v0.5/rocket/http/struct.ContentType.html
[`Method`]: https://api.rocket.rs/v0.5/rocket/http/enum.Method.html
[`(ContentType, T)`]: https://api.rocket.rs/v0.5/rocket/response/content/index.html#usage
[v0.4 to v0.5 migration guide]: https://rocket.rs/v0.5/guide/upgrading/
[contrib deprecation upgrade guide]: https://rocket.rs/v0.5/guide/upgrading/#contrib-deprecation
[FAQ]: https://rocket.rs/v0.5/guide/faq/
[`Rocket::launch()`]: https://api.rocket.rs/v0.5/rocket/struct.Rocket.html#method.launch
[`ErrorKind::Shutdown`]: https://api.rocket.rs/v0.5/rocket/error/enum.ErrorKind.html#variant.Shutdown
[shutdown fairings]: https://api.rocket.rs/v0.5/rocket/fairing/trait.Fairing.html#shutdown
[`Client::terminate()`]: https://api.rocket.rs/v0.5/rocket/local/blocking/struct.Client.html#method.terminate
[`rocket::execute()`]: https://api.rocket.rs/v0.5/rocket/fn.execute.html
[`CookieJar::get_pending()`]: https://api.rocket.rs/v0.5/rocket/http/struct.CookieJar.html#method.get_pending
[`Metadata::render()`]: https://api.rocket.rs/v0.5/rocket_dyn_templates/struct.Metadata.html#method.render
[`pool()`]: https://api.rocket.rs/v0.5/rocket_sync_db_pools/example/struct.ExampleDb.html#method.pool
[`Request::client_ip()`]: https://api.rocket.rs/v0.5/rocket/request/struct.Request.html#method.client_ip
[`max_blocking`]: https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.max_blocking
[`ip_header`]: https://api.rocket.rs/v0.5/rocket/struct.Config.html#structfield.ip_header
[`LocalRequest::identity()`]: https://api.rocket.rs/v0.5/rocket/local/blocking/struct.LocalRequest.html#method.identity
[`TempFile::open()`]: https://api.rocket.rs/v0.5/rocket/fs/enum.TempFile.html#method.open
[`Error::pretty_print()`]: https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.pretty_print
[Request connection upgrade APIs]: https://api.rocket.rs/v0.5/rocket/struct.Response.html#upgrading
[`rocket_ws`]: https://api.rocket.rs/v0.5/rocket_ws/
[registering]: https://api.rocket.rs/v0.5/rocket/response/struct.Response.html#method.add_upgrade
[`IoHandler`]: https://api.rocket.rs/v0.5/rocket/data/trait.IoHandler.html
[`response::status`]: https://api.rocket.rs/v0.5/rocket/response/status/index.html
[Custom form errors]: https://api.rocket.rs/v0.5/rocket/form/error/enum.ErrorKind.html#variant.Custom
[`request::Outcome`]: https://api.rocket.rs/v0.5/rocket/request/type.Outcome.html#variant.Forward
[Route `Forward` outcomes]: https://api.rocket.rs/v0.5/rocket/request/type.Outcome.html#variant.Forward
[`Outcome::Error`]: https://api.rocket.rs/v0.5/rocket/outcome/enum.Outcome.html#variant.Error
[`IntoOutcome`]: https://api.rocket.rs/v0.5/rocket/outcome/trait.IntoOutcome.html
[`MediaType::JavaScript`]: https://api.rocket.rs/v0.5/rocket/http/struct.MediaType.html#associatedconstant.JavaScript
[`TempFile::open()`]: https://api.rocket.rs/v0.5/rocket/fs/enum.TempFile.html#method.open
[`Error::pretty_print()`]: https://api.rocket.rs/v0.5/rocket/struct.Error.html#method.pretty_print
[`RouteUri`]: https://api.rocket.rs/v0.5/rocket/route/struct.RouteUri.html
# Version 0.4.10 (May 21, 2021)
## Core
* [[`3276b8`]] Removed `unsafe` in `Origin::parse_owned()`, fixing a soundness
issue.
[`3276b8`]: https://github.com/rwf2/Rocket/commit/3276b8
# Version 0.4.9 (May 19, 2021)
## Core
* [[`#1645`], [`f2a56f`]] Fixed `Try` `impl FromResidual<Result> for Outcome`.
[`#1645`]: https://github.com/rwf2/Rocket/issues/1645
[`f2a56f`]: https://github.com/rwf2/Rocket/commit/f2a56f
# Version 0.4.8 (May 18, 2021)
## Core
* [[`#1548`], [`93e88b0`]] Fixed an issue that prevented compilation under
Windows Subsystem for Linux v1.
* Updated `Outcome` `Try` implementation to v2 in latest nightly.
* Minimum required `rustc` is `1.54.0-nightly (2021-05-18)`.
## Internal
* Updated `base64` dependency to `0.13`.
[`#1548`]: https://github.com/rwf2/Rocket/issues/1548
[`93e88b0`]: https://github.com/rwf2/Rocket/commit/93e88b0
# Version 0.4.7 (Feb 09, 2021)
## Core
* [[#1534], [`2059a6`]] Fixed a low-severity, minimal impact soundness issue
in `uri::Formatter`.
[#1534]: https://github.com/rwf2/Rocket/issues/1534
[`2059a6`]: https://github.com/rwf2/Rocket/commit/2059a6
# Version 0.4.6 (Nov 09, 2020)
## Core
* [[`86bd7c`]] Added default and configurable read/write timeouts:
`read_timeout` and `write_timeout`.
* [[`c24a96`]] Added the `sse` feature, which [enables flushing] by returning
`io::ErrorKind::WouldBlock`.
## Docs
* Fixed broken doc links in `contrib`.
* Fixed database library versions in `contrib` docs.
## Internal
* Updated source code for Rust 2018.
* UI tests now use `trybuild` instead of `compiletest-rs`.
[`86bd7c`]: https://github.com/rwf2/Rocket/commit/86bd7c
[`c24a96`]: https://github.com/rwf2/Rocket/commit/c24a96
[enables flushing]: https://api.rocket.rs/v0.4/rocket/response/struct.Stream.html#buffering-and-blocking
# Version 0.4.5 (May 30, 2020)
## Core
* [[#1312], [`89150f`]] Fixed a low-severity, minimal impact soundness issue in
`LocalRequest::clone()`.
* [[#1263], [`376f74`]] Fixed a cookie serialization issue that led to
incorrect cookie deserialization in certain cases.
* Removed dependency on `ring` for private cookies and thus Rocket, by
default.
* Added [`Origin::map_path()`] for manipulating `Origin` paths.
* Added [`handler::Outcome::from_or_forward()`].
* Added [`Options::NormalizeDirs`] option to `StaticFiles`.
* Improved accessibility of default error HTML.
## Docs
* Fixed various typos.
[#1312]: https://github.com/rwf2/Rocket/issues/1312
[`89150f`]: https://github.com/rwf2/Rocket/commit/89150f
[#1263]: https://github.com/rwf2/Rocket/issues/1263
[`376f74`]: https://github.com/rwf2/Rocket/commit/376f74
[`Origin::map_path()`]: https://api.rocket.rs/v0.4/rocket/http/uri/struct.Origin.html#method.map_path
[`handler::Outcome::from_or_forward()`]: https://api.rocket.rs/v0.4/rocket/handler/type.Outcome.html#method.from_or_forward
[`Options::NormalizeDirs`]: https://api.rocket.rs/v0.4/rocket_contrib/serve/struct.Options.html#associatedconstant.NormalizeDirs
# Version 0.4.4 (Mar 09, 2020)
## Core
* Removed use of unsupported `cfg(debug_assertions)` in `Cargo.toml`, allowing
for builds on latest nightlies.
## Docs
* Fixed various broken links.
# Version 0.4.3 (Feb 29, 2020)
## Core
* Added a new [`Debug`] `500` `Responder` that `Debug`-prints its contents on
response.
* Specialization on `Result` was deprecated. [`Debug`] can be used in place of
non-`Responder` errors.
* Fixed an issue that resulted in cookies not being set on error responses.
* Various `Debug` implementations on Rocket types now respect formatting
options.
* Added `Responder`s for various HTTP status codes: [`NoContent`],
[`Unauthorized`], [`Forbidden`], and [`Conflict`].
* `FromParam` is implemented for `NonZero` core types.
## Codegen
* Docs for Rocket-generated macros are now hidden.
* Generated code now works even when prelude imports like `Some`, `Ok`, and
`Err` are shadowed.
* Error messages referring to responder types in routes now point to the type
correctly.
## Docs
* All code examples in the guide are now tested and guaranteed to compile.
* All macros are documented in the `core` crate; `rocket_codegen` makes no
appearances.
## Infrastructure
* CI was moved from Travis to Azure Pipelines; Windows support is tested.
* Rocket's chat moved to [Matrix] and [Freenode].
[`Debug`]: https://api.rocket.rs/v0.4/rocket/response/struct.Debug.html
[`NoContent`]: https://api.rocket.rs/v0.4/rocket/response/status/struct.NoContent.html
[`Unauthorized`]: https://api.rocket.rs/v0.4/rocket/response/status/struct.Unauthorized.html
[`Forbidden`]: https://api.rocket.rs/v0.4/rocket/response/status/struct.Forbidden.html
[`Conflict`]: https://api.rocket.rs/v0.4/rocket/response/status/struct.Conflict.html
[Matrix]: https://chat.mozilla.org/#/room/#rocket:mozilla.org
[Freenode]: https://kiwiirc.com/client/chat.freenode.net/#rocket
# Version 0.4.2 (Jun 28, 2019)
## Core
* Replaced use of `FnBox` with `Box<dyn FnOnce>`.
* Removed the stable feature gates `try_from` and `transpose_result`.
* Derive macros are reexported alongside their respective traits.
* Minimum required `rustc` is `1.35.0-nightly (2019-04-05)`.
## Codegen
* `JsonValue` now implements `FromIterator`.
* `non_snake_case` errors are silenced in generated code.
* Minimum required `rustc` is `1.33.0-nightly (2019-01-03)`.
## Contrib
* Allow setting custom ranks on `StaticFiles` via [`StaticFiles::rank()`].
* `MsgPack` correctly sets a MessagePack Content-Type on responses.
## Docs
* Fixed typos across rustdocs and guide.
* Documented library versions in contrib database documentation.
## Infrastructure
* Updated internal dependencies to their latest versions.
[`StaticFiles::rank()`]: https://api.rocket.rs/v0.4/rocket_contrib/serve/struct.StaticFiles.html#method.rank
# Version 0.4.1 (May 11, 2019)
## Core
* Rocket's default `Server` HTTP header no longer overrides a user-set header.
* Fixed encoding and decoding of certain URI characters.
## Codegen
* Compiler diagnostic information is more reliably produced.
## Contrib
* Database pool types now implement `DerefMut`.
* Added support for memcache connection pools.
* Stopped depending on default features from core.
## Docs
* Fixed many typos across the rustdocs and guide.
* Added guide documentation on mounting more than one route at once.
## Infrastructure
* Testing no longer requires "bootstrapping".
* Removed deprecated `isatty` dependency in favor of `atty`.
# Version 0.4.0 (Dec 06, 2018)
## New Features
This release includes the following new features:
* Introduced [Typed URIs].
* Introduced [ORM agnostic database support].
* Introduced [Request-Local State].
* Introduced mountable static-file serving via [`StaticFiles`].
* Introduced automatic [live template reloading].
* Introduced custom stateful handlers via [`Handler`].
* Introduced [transforming] data guards via [`FromData::transform()`].
* Introduced revamped [query string handling].
* Introduced the [`SpaceHelmet`] security and privacy headers fairing.
* Private cookies are gated behind a `private-cookies` default feature.
* Added [derive for `FromFormValue`].
* Added [derive for `Responder`].
* Added [`Template::custom()`] for customizing templating engines including
registering filters and helpers.
* Cookies are automatically tracked and propagated by [`Client`].
* Private cookies can be added to local requests with
[`LocalRequest::private_cookie()`].
* Release builds default to the `production` environment.
* Keep-alive can be configured via the `keep_alive` configuration parameter.
* Allow CLI colors and emoji to be disabled with `ROCKET_CLI_COLORS=off`.
* Route `format` accepts [shorthands] such as `json` and `html`.
* Implemented [`Responder` for `Status`].
* Added [`Response::cookies()`] for retrieving response cookies.
* All logging is disabled when `log` is set to `off`.
* Added [`Metadata`] guard for retrieving templating information.
* The [`Uri`] type parses URIs according to RFC 7230 into one of [`Origin`],
[`Absolute`], or [`Authority`].
* Added [`Outcome::and_then()`], [`Outcome::failure_then()`], and
[`Outcome::forward_then()`].
* Implemented `Responder` for `&[u8]`.
* Any `T: Into<Vec<Route>>` can be [`mount()`]ed.
* [Default rankings] range from -6 to -1, differentiating on static query
strings.
* Added [`Request::get_query_value()`] for retrieving a query value by key.
* Applications can launch without a working directory.
* Added [`State::from()`] for constructing `State` values.
[`SpaceHelmet`]: https://api.rocket.rs/v0.4/rocket_contrib/helmet/index.html
[`State::from()`]: https://api.rocket.rs/v0.4/rocket/struct.State.html#method.from
[Typed URIs]: https://rocket.rs/v0.4/guide/responses/#typed-uris
[ORM agnostic database support]: https://rocket.rs/v0.4/guide/state/#databases
[`Template::custom()`]: https://api.rocket.rs/v0.4/rocket_contrib/templates/struct.Template.html#method.custom
[`LocalRequest::private_cookie()`]: https://api.rocket.rs/v0.4/rocket/local/struct.LocalRequest.html#method.private_cookie
[`LocalRequest`]: https://api.rocket.rs/v0.4/rocket/local/struct.LocalRequest.html
[shorthands]: https://api.rocket.rs/v0.4/rocket/http/struct.ContentType.html#method.parse_flexible
[derive for `FromFormValue`]: https://api.rocket.rs/v0.4/rocket_codegen/derive.FromFormValue.html
[derive for `Responder`]: https://api.rocket.rs/v0.4/rocket_codegen/derive.Responder.html
[`Response::cookies()`]: https://api.rocket.rs/v0.4/rocket/struct.Response.html#method.cookies
[`Client`]: https://api.rocket.rs/v0.4/rocket/local/struct.Client.html
[Request-Local State]: https://rocket.rs/v0.4/guide/state/#request-local-state
[`Metadata`]: https://api.rocket.rs/v0.4/rocket_contrib/templates/struct.Metadata.html
[`Uri`]: https://api.rocket.rs/v0.4/rocket/http/uri/enum.Uri.html
[`Origin`]: https://api.rocket.rs/v0.4/rocket/http/uri/struct.Origin.html
[`Absolute`]: https://api.rocket.rs/v0.4/rocket/http/uri/struct.Absolute.html
[`Authority`]: https://api.rocket.rs/v0.4/rocket/http/uri/struct.Authority.html
[`Outcome::and_then()`]: https://api.rocket.rs/v0.4/rocket/enum.Outcome.html#method.and_then
[`Outcome::forward_then()`]: https://api.rocket.rs/v0.4/rocket/enum.Outcome.html#method.forward_then
[`Outcome::failure_then()`]: https://api.rocket.rs/v0.4/rocket/enum.Outcome.html#method.failure_then
[`StaticFiles`]: https://api.rocket.rs/v0.4/rocket_contrib/serve/struct.StaticFiles.html
[live template reloading]: https://rocket.rs/v0.4/guide/responses/#live-reloading
[`Handler`]: https://api.rocket.rs/v0.4/rocket/trait.Handler.html
[`mount()`]: https://api.rocket.rs/v0.4/rocket/struct.Rocket.html#method.mount
[`FromData::transform()`]: https://api.rocket.rs/v0.4/rocket/data/trait.FromData.html#tymethod.transform
[transforming]: https://api.rocket.rs/v0.4/rocket/data/trait.FromData.html#transforming
[query string handling]: https://rocket.rs/v0.4/guide/requests/#query-strings
[Default rankings]: https://rocket.rs/v0.4/guide/requests/#default-ranking
[`Request::get_query_value()`]: https://api.rocket.rs/v0.4/rocket/struct.Request.html#method.get_query_value
[`Responder` for `Status`]: https://rocket.rs/v0.4/guide/responses/#status
## Codegen Rewrite
The [`rocket_codegen`] crate has been entirely rewritten using to-be-stable
procedural macro APIs. We expect nightly breakages to drop dramatically, likely
to zero, as a result. The new prelude import for Rocket applications is:
```diff
- #![feature(plugin)]
- #![plugin(rocket_codegen)]
+ #![feature(proc_macro_hygiene, decl_macro)]
- extern crate rocket;
+ #[macro_use] extern crate rocket;
```
The [`rocket_codegen`] crate should **_not_** be a direct dependency. Remove it
from your `Cargo.toml`:
```diff
[dependencies]
- rocket = "0.3"
+ rocket = "0.4"
- rocket_codegen = "0.3"
```
[`rocket_codegen`]: https://api.rocket.rs/v0.4/rocket_codegen/index.html
## Breaking Changes
This release includes many breaking changes. These changes are listed below
along with a short note about how to handle the breaking change in existing
applications when applicable.
* **Route and catcher attributes respect function privacy.**
To mount a route or register a catcher outside of the module it is declared,
ensure that the handler function is marked `pub` or `crate`.
* **Query handling syntax has been completely revamped.**
A query parameter of `<param>` is now `<param..>`. Consider whether your
application benefits from the revamped [query string handling].
* **The `#[error]` attribute and `errors!` macro were removed.**
Use `#[catch]` and `catchers!` instead.
* **`Rocket::catch()` was renamed to [`Rocket::register()`].**
Change calls of the form `.catch(errors![..])` to
`.register(catchers![..])`.
* **The `#[catch]` attribute only accepts functions with 0 or 1 argument.**
Ensure the argument to the catcher, if any, is of type `&Request`.
* **[`json!`] returns a [`JsonValue`], no longer needs wrapping.**
Change instances of `Json(json!(..))` to `json!` and change the
corresponding type to `JsonValue`.
* **All environments default to port 8000.**
Manually configure a port of `80` for the `stage` and `production`
environments for the previous behavior.
* **Release builds default to the production environment.**
Manually set the environment to `debug` with `ROCKET_ENV=debug` for the
previous behavior.
* **[`Form`] and [`LenientForm`] lost a lifetime parameter, `get()` method.**
Change a type of `Form<'a, T<'a>>` to `Form<T>` or `Form<T<'a>>`. `Form<T>`
and `LenientForm<T>` now implement `Deref<Target = T>`, allowing for calls
to `.get()` to be removed.
* **[`ring`] was updated to 0.13.**
Ensure all transitive dependencies to `ring` refer to version `0.13`.
* **`Uri` was largely replaced by [`Origin`].**
In general, replace the type `Uri` with `Origin`. The `base` and `uri`
fields of [`Route`] are now of type [`Origin`]. The `&Uri` guard is now
`&Origin`. [`Request::uri()`] now returns an [`Origin`].
* **All items in [`rocket_contrib`] are namespaced behind modules.**
* `Json` is now `json::Json`
* `MsgPack` is now `msgpack::MsgPack`
* `MsgPackError` is now `msgpack::Error`
* `Template` is now `templates::Template`
* `UUID` is now `uuid::Uuid`
* `Value` is replaced by `json::JsonValue`
* **TLS certificates require the `subjectAltName` extension.**
Ensure that your TLS certificates contain the `subjectAltName` extension
with a value set to your domain.
* **Route paths, mount points, and [`LocalRequest`] URIs are strictly
checked.**
Ensure your mount points are absolute paths with no parameters, ensure your
route paths are absolute paths with proper parameter syntax, and ensure that
paths passed to `LocalRequest` are valid.
* **[`Template::show()`] takes an `&Rocket`, doesn't accept a `root`.**
Use [`client.rocket()`] to get a reference to an instance of `Rocket` when
testing. Use [`Template::render()`] in routes.
* **[`Request::remote()`] returns the _actual_ remote IP, doesn't rewrite.**
Use [`Request::real_ip()`] or [`Request::client_ip()`] to retrieve the IP
address from the "X-Real-IP" header if it is present.
* **[`Bind`] variant was added to [`LaunchErrorKind`].**
Ensure matches on `LaunchErrorKind` include or ignore the `Bind` variant.
* **Cookies are automatically tracked and propagated by [`Client`].**
For the previous behavior, construct a `Client` with
[`Client::untracked()`].
* **`UUID` was renamed to [`Uuid`].**
Use `Uuid` instead of `UUID`.
* **`LocalRequest::cloned_dispatch()` was removed.**
Chain calls to `.clone().dispatch()` for the previous behavior.
* **[`Redirect`] constructors take a generic type of `T:
TryInto<Uri<'static>>`.**
A call to a `Redirect` constructor with a non-`'static` `&str` of the form
`Redirect::to(string)` should become `Redirect::to(string.to_string())`,
heap-allocating the string before being passed to the constructor.
* **The [`FromData`] impl for [`Form`] and [`LenientForm`] now return an error
of type [`FormDataError`].**
On non-I/O errors, the form string is stored in the variant as an `&'f str`.
* **[`Missing`] variant was added to [`ConfigError`].**
Ensure matches on `ConfigError` include or ignore the `Missing` variant.
* **The [`FromData`] impl for [`Json`] now returns an error of type
[`JsonError`].**
The previous `SerdeError` is now the `.1` member of the `JsonError` `enum`.
Match and destruct the variant for the previous behavior.
* **[`FromData`] is now emulated by [`FromDataSimple`].**
Change _implementations_, not uses, of `FromData` to `FromDataSimple`.
Consider whether your implementation could benefit from [transformations].
* **[`FormItems`] iterates over values of type [`FormItem`].**
Map using `.map(|item| item.key_value())` for the previous behavior.
* **[`LaunchErrorKind::Collision`] contains a vector of the colliding routes.**
Destruct using `LaunchErrorKind::Collision(..)` to ignore the vector.
* **[`Request::get_param()`] and [`Request::get_segments()`] are indexed by
_segment_, not dynamic parameter.**
Modify the `n` argument in calls to these functions appropriately.
* **Method-based route attributes no longer accept a keyed `path` parameter.**
Change an attribute of the form `#[get(path = "..")]` to `#[get("..")]`.
* **[`Json`] and [`MsgPack`] data guards no longer reject requests with an
unexpected Content-Type**
To approximate the previous behavior, add a `format = "json"` route
parameter when using `Json` or `format = "msgpack"` when using `MsgPack`.
* **Implemented [`Responder` for `Status`]. Removed `Failure`,
`status::NoContent`, and `status::Reset` responders.**
Replace uses of `Failure(status)` with `status` directly. Replace
`status::NoContent` with `Status::NoContent`. Replace `status::Reset` with
`Status::ResetContent`.
* **[`Config::root()`] returns an `Option<&Path>` instead of an `&Path`.**
For the previous behavior, use `config.root().unwrap()`.
* **[`Status::new()`] is no longer `const`.**
Construct a `Status` directly.
* **[`Config`] constructors return a `Config` instead of a `Result<Config>`.**
* **`ConfigError::BadCWD`, `Config.config_path` were removed.**
* **[`Json`] no longer has a default value for its type parameter.**
* **Using `data` on a non-payload method route is a warning instead of error.**
* **The `raw_form_string` method of [`Form`] and [`LenientForm`] was
removed.**
* **Various impossible `Error` associated types are now set to `!`.**
* **All [`AdHoc`] constructors require a name as the first parameter.**
* **The top-level `Error` type was removed.**
[`LaunchErrorKind::Collision`]: https://api.rocket.rs/v0.4/rocket/error/enum.LaunchErrorKind.html#variant.Collision
[`json!`]: https://api.rocket.rs/v0.4/rocket_contrib/macro.json.html
[`JsonValue`]: https://api.rocket.rs/v0.4/rocket_contrib/json/struct.JsonValue.html
[`Json`]: https://api.rocket.rs/v0.4/rocket_contrib/json/struct.Json.html
[`ring`]: https://crates.io/crates/ring
[`Template::show()`]: https://api.rocket.rs/v0.4/rocket_contrib/templates/struct.Template.html#method.show
[`Template::render()`]: https://api.rocket.rs/v0.4/rocket_contrib/templates/struct.Template.html#method.render
[`client.rocket()`]: https://api.rocket.rs/v0.4/rocket/local/struct.Client.html#method.rocket
[`Request::remote()`]: https://api.rocket.rs/v0.4/rocket/struct.Request.html#method.remote
[`Request::real_ip()`]: https://api.rocket.rs/v0.4/rocket/struct.Request.html#method.real_ip
[`Request::client_ip()`]: https://api.rocket.rs/v0.4/rocket/struct.Request.html#method.client_ip
[`Bind`]: https://api.rocket.rs/v0.4/rocket/error/enum.LaunchErrorKind.html#variant.Bind
[`LaunchErrorKind`]: https://api.rocket.rs/v0.4/rocket/error/enum.LaunchErrorKind.html
[`Client::untracked()`]: https://api.rocket.rs/v0.4/rocket/local/struct.Client.html#method.untracked
[`Uuid`]: https://api.rocket.rs/v0.4/rocket_contrib/uuid/struct.Uuid.html
[`Route`]: https://api.rocket.rs/v0.4/rocket/struct.Route.html
[`Redirect`]: https://api.rocket.rs/v0.4/rocket/response/struct.Redirect.html
[`Request::uri()`]: https://api.rocket.rs/v0.4/rocket/struct.Request.html#method.uri
[`FormDataError`]: https://api.rocket.rs/v0.4/rocket/request/enum.FormDataError.html
[`FromData`]: https://api.rocket.rs/v0.4/rocket/data/trait.FromData.html
[`Form`]: https://api.rocket.rs/v0.4/rocket/request/struct.Form.html
[`LenientForm`]: https://api.rocket.rs/v0.4/rocket/request/struct.LenientForm.html
[`AdHoc`]: https://api.rocket.rs/v0.4/rocket/fairing/struct.AdHoc.html
[`Missing`]: https://api.rocket.rs/v0.4/rocket/config/enum.ConfigError.html#variant.Missing
[`ConfigError`]: https://api.rocket.rs/v0.4/rocket/config/enum.ConfigError.html
[`Rocket::register()`]: https://api.rocket.rs/v0.4/rocket/struct.Rocket.html#method.register
[`JsonError`]: https://api.rocket.rs/v0.4/rocket_contrib/json/enum.JsonError.html
[transformations]: https://api.rocket.rs/v0.4/rocket/data/trait.FromData.html#transforming
[`FromDataSimple`]: https://api.rocket.rs/v0.4/rocket/data/trait.FromDataSimple.html
[`Request::get_param()`]: https://api.rocket.rs/v0.4/rocket/struct.Request.html#method.get_param
[`Request::get_segments()`]: https://api.rocket.rs/v0.4/rocket/struct.Request.html#method.get_segments
[`FormItem`]: https://api.rocket.rs/v0.4/rocket/request/struct.FormItem.html
[`rocket_contrib`]: https://api.rocket.rs/v0.4/rocket_contrib/index.html
[`MsgPack`]: https://api.rocket.rs/v0.4/rocket_contrib/msgpack/struct.MsgPack.html
[`Status::new()`]: https://api.rocket.rs/v0.4/rocket/http/struct.Status.html#method.new
[`Config`]: https://api.rocket.rs/v0.4/rocket/struct.Config.html
[`Config::root()`]: https://api.rocket.rs/v0.4/rocket/struct.Config.html#method.root
## General Improvements
In addition to new features, Rocket saw the following improvements:
* Log messages now refer to routes by name.
* Collision errors on launch name the colliding routes.
* Launch fairing failures refer to the failing fairing by name.
* The default `403` catcher now references authorization, not authentication.
* Private cookies are set to `HttpOnly` and are given an expiration date of 1
week by default.
* A [Tera templates example] was added.
* All macros, derives, and attributes are individually documented in
[`rocket_codegen`].
* Invalid client requests receive a response of `400` instead of `500`.
* Response bodies are reliably stripped on `HEAD` requests.
* Added a default catcher for `504: Gateway Timeout`.
* Configuration information is logged in all environments.
* Use of `unsafe` was reduced from 9 to 2 in core library.
* [`FormItems`] now parses empty keys and values as well as keys without
values.
* Added [`Config::active()`] as a shorthand for
`Config::new(Environment::active()?)`.
* Address/port binding errors at launch are detected and explicitly emitted.
* [`Flash`] cookies are cleared only after they are inspected.
* `Sync` bound on [`AdHoc::on_attach()`], [`AdHoc::on_launch()`] was removed.
* [`AdHoc::on_attach()`], [`AdHoc::on_launch()`] accept an `FnOnce`.
* Added [`Config::root_relative()`] for retrieving paths relative to the
configuration file.
* Added [`Config::tls_enabled()`] for determining whether TLS is actively
enabled.
* ASCII color codes are not emitted on versions of Windows that do not support
them.
* Added FLAC (`audio/flac`), Icon (`image/x-icon`), WEBA (`audio/webm`), TIFF
(`image/tiff`), AAC (`audio/aac`), Calendar (`text/calendar`), MPEG
(`video/mpeg`), TAR (`application/x-tar`), GZIP (`application/gzip`), MOV
(`video/quicktime`), MP4 (`video/mp4`), ZIP (`application/zip`) as known
media types.
* Added `.weba` (`WEBA`), `.ogv` (`OGG`), `.mp4` (`MP4`), `.mpeg4` (`MP4`),
`.aac` (`AAC`), `.ics` (`Calendar`), `.bin` (`Binary`), `.mpg` (`MPEG`),
`.mpeg` (`MPEG`), `.tar` (`TAR`), `.gz` (`GZIP`), `.tif` (`TIFF`), `.tiff`
(`TIFF`), `.mov` (`MOV`) as known extensions.
* Interaction between route attributes and declarative macros has been
improved.
* Generated code now logs through logging infrastructures as opposed to using
`println!`.
* Routing has been optimized by caching routing metadata.
* [`Form`] and [`LenientForm`] can be publicly constructed.
* Console coloring uses default terminal colors instead of white.
* Console coloring is consistent across all messages.
* `i128` and `u128` now implement [`FromParam`], [`FromFormValue`].
* The `base64` dependency was updated to `0.10`.
* The `log` dependency was updated to `0.4`.
* The `handlebars` dependency was updated to `1.0`.
* The `tera` dependency was updated to `0.11`.
* The `uuid` dependency was updated to `0.7`.
* The `rustls` dependency was updated to `0.14`.
* The `cookie` dependency was updated to `0.11`.
[Tera templates example]: https://github.com/rwf2/Rocket/tree/v0.4/examples/tera_templates
[`FormItems`]: https://api.rocket.rs/v0.4/rocket/request/enum.FormItems.html
[`Config::active()`]: https://api.rocket.rs/v0.4/rocket/config/struct.Config.html#method.active
[`Flash`]: https://api.rocket.rs/v0.4/rocket/response/struct.Flash.html
[`AdHoc::on_attach()`]: https://api.rocket.rs/v0.4/rocket/fairing/struct.AdHoc.html#method.on_attach
[`AdHoc::on_launch()`]: https://api.rocket.rs/v0.4/rocket/fairing/struct.AdHoc.html#method.on_launch
[`Config::root_relative()`]: https://api.rocket.rs/v0.4/rocket/struct.Config.html#method.root_relative
[`Config::tls_enabled()`]: https://api.rocket.rs/v0.4/rocket/struct.Config.html#method.tls_enabled
[`rocket_codegen`]: https://api.rocket.rs/v0.4/rocket_codegen/index.html
[`FromParam`]: https://api.rocket.rs/v0.4/rocket/request/trait.FromParam.html
[`FromFormValue`]: https://api.rocket.rs/v0.4/rocket/request/trait.FromFormValue.html
[`Data`]: https://api.rocket.rs/v0.4/rocket/struct.Data.html
## Infrastructure
* All documentation is versioned.
* Previous, current, and development versions of all documentation are hosted.
* The repository was reorganized with top-level directories of `core` and
`contrib`.
* The `http` module was split into its own `rocket_http` crate. This is an
internal change only.
* All uses of `unsafe` are documented with informal proofs of correctness.
# Version 0.3.16 (Aug 24, 2018)
## Codegen
* Codegen was updated for `2018-08-23` nightly.
* Minimum required `rustc` is `1.30.0-nightly 2018-08-23`.
## Core
* Force close only the read end of connections. This allows responses to be
sent even when the client transmits more data than expected.
## Docs
* Add details on retrieving configuration extras to guide.
# Version 0.3.15 (Jul 16, 2018)
## Codegen
* The `#[catch]` decorator and `catchers!` macro were introduced, replacing
`#[error]` and `errors!`.
* The `#[error]` decorator and `errors!` macro were deprecated.
* Codegen was updated for `2018-07-15` nightly.
* Minimum required `rustc` is `1.29.0-nightly 2018-07-15`.
# Version 0.3.14 (Jun 22, 2018)
## Codegen
* Codegen was updated for `2018-06-22` nightly.
* Minimum required `rustc` is `1.28.0-nightly 2018-06-22`.
# Version 0.3.13 (Jun 16, 2018)
## Codegen
* Codegen was updated for `2018-06-12` nightly.
* Minimum required `rustc` is `1.28.0-nightly 2018-06-12`.
# Version 0.3.12 (May 31, 2018)
## Codegen
* Codegen was updated for `2018-05-30` nightly.
* Minimum required `rustc` is `1.28.0-nightly 2018-05-30`.
# Version 0.3.11 (May 19, 2018)
## Core
* Core was updated for `2018-05-18` nightly.
## Infrastructure
* Fixed injection of dependencies for codegen compile-fail tests.
# Version 0.3.10 (May 05, 2018)
## Core
* Fixed parsing of nested TOML structures in config environment variables.
## Codegen
* Codegen was updated for `2018-05-03` nightly.
* Minimum required `rustc` is `1.27.0-nightly 2018-05-04`.
## Contrib
* Contrib was updated for `2018-05-03` nightly.
## Docs
* Fixed database pool type in state guide.
# Version 0.3.9 (Apr 26, 2018)
## Core
* Core was updated for `2018-04-26` nightly.
* Minimum required `rustc` is `1.27.0-nightly 2018-04-26`.
* Managed state retrieval cost was reduced to an unsynchronized `HashMap`
lookup.
## Codegen
* Codegen was updated for `2018-04-26` nightly.
* Minimum required `rustc` is `1.27.0-nightly 2018-04-26`.
## Contrib
* A 512-byte buffer is preallocated when deserializing JSON, improving
performance.
## Docs
* Fixed various typos in rustdocs and guide.
# Version 0.3.8 (Apr 07, 2018)
## Codegen
* Codegen was updated for `2018-04-06` nightly.
* Minimum required `rustc` is `1.27.0-nightly 2018-04-06`.
# Version 0.3.7 (Apr 03, 2018)
## Core
* Fixed a bug where incoming request URIs would match routes with the same
path prefix and suffix and ignore the rest.
* Added known media types for WASM, WEBM, OGG, and WAV.
* Fixed fragment URI parsing.
## Codegen
* Codegen was updated for `2018-04-03` nightly.
* Minimum required `rustc` is `1.27.0-nightly 2018-04-03`.
## Contrib
* JSON data is read eagerly, improving deserialization performance.
## Docs
* Database example and docs were updated for Diesel 1.1.
* Removed outdated README performance section.
* Fixed various typos in rustdocs and guide.
## Infrastructure
* Removed gates for stabilized features: `iterator_for_each`, `i128_type`,
`conservative_impl_trait`, `never_type`.
* Travis now tests in both debug and release mode.
# Version 0.3.6 (Jan 12, 2018)
## Core
* `Rocket.state()` method was added to retrieve managed state from `Rocket`
instances.
* Nested calls to `Rocket.attach()` are now handled correctly.
* JSON API (`application/vnd.api+json`) is now a known media type.
* Uncached markers for `ContentType` and `Accept` headers are properly
preserved on `Request.clone()`.
* Minimum required `rustc` is `1.25.0-nightly 2018-01-12`.
## Codegen
* Codegen was updated for `2017-12-22` nightly.
* Minimum required `rustc` is `1.24.0-nightly 2017-12-22`.
## Docs
* Fixed typo in state guide: ~~simple~~ simply.
* Database example and docs were updated for Diesel 1.0.
## Infrastructure
* Shell scripts now use `git grep` instead of `egrep` for faster searching.
# Version 0.3.5 (Dec 18, 2017)
## Codegen
* Codegen was updated for `2017-12-17` nightly.
* Minimum required `rustc` is `1.24.0-nightly 2017-12-17`.
# Version 0.3.4 (Dec 14, 2017)
## Core
* `NamedFile`'s `Responder` implementation now uses a sized body when the
file's length is known.
* `#[repr(C)]` is used on `str` wrappers to guarantee correct structure layout
across platforms.
* A `status::BadRequest` `Responder` was added.
## Codegen
* Codegen was updated for `2017-12-13` nightly.
* Minimum required `rustc` is `1.24.0-nightly 2017-12-13`.
## Docs
* The rustdoc `html_root_url` now points to the correct address.
* Fixed typo in fairings guide: ~~event~~ events.
* Fixed typo in `Outcome` docs: ~~users~~ Users.
# Version 0.3.3 (Sep 25, 2017)
## Core
* `Config`'s `Debug` implementation now respects formatting options.
* `Cow<str>` now implements `FromParam`.
* `Vec<u8>` now implements `Responder`.
* Added a `Binary` media type for `application/octet-stream`.
* Empty fairing collections are no longer logged.
* Emojis are no longer emitted to non-terminals.
* Minimum required `rustc` is `1.22.0-nightly 2017-09-13`.
## Codegen
* Improved "missing argument in handler" compile-time error message.
* Codegen was updated for `2017-09-25` nightly.
* Minimum required `rustc` is `1.22.0-nightly 2017-09-25`.
## Docs
* Fixed typos in site overview: ~~by~~ be, ~~`Reponder`~~ `Responder`.
* Markdown indenting was adjusted for CommonMark.
## Infrastructure
* Shell scripts handle paths with spaces.
# Version 0.3.2 (Aug 15, 2017)
## Core
* Added conversion methods from and to `Box<UncasedStr>`.
## Codegen
* Lints were removed due to compiler instability. Lints will likely return as
a separate `rocket_lints` crate.
# Version 0.3.1 (Aug 11, 2017)
## Core
* Added support for ASCII colors on modern Windows consoles.
* Form field renames can now include _any_ valid characters, not just idents.
## Codegen
* Ignored named route parameters are now allowed (`_ident`).
* Fixed issue where certain paths would cause a lint `assert!` to fail
([#367](https://github.com/rwf2/Rocket/issues/367)).
* Lints were updated for `2017-08-10` nightly.
* Minimum required `rustc` is `1.21.0-nightly (2017-08-10)`.
## Contrib
* Tera errors that were previously skipped internally are now emitted.
## Documentation
* Typos were fixed across the board.
# Version 0.3.0 (Jul 14, 2017)
## New Features
This release includes the following new features:
* [Fairings], Rocket's structure middleware, were introduced.
* [Native TLS support] was introduced.
* [Private cookies] were introduced.
* A [`MsgPack`] type has been added to [`contrib`] for simple consumption and
returning of MessagePack data.
* Launch failures ([`LaunchError`]) from [`Rocket::launch()`] are now returned
for inspection without panicking.
* Routes without query parameters now match requests with or without query
parameters.
* [Default rankings] range from -4 to -1, preferring static paths and routes
with query string matches.
* A native [`Accept`] header structure was added.
* The [`Accept`] request header can be retrieved via [`Request::accept()`].
* Incoming form fields [can be renamed] via a new `#[form(field = "name")]`
structure field attribute.
* All active routes can be retrieved via [`Rocket::routes()`].
* [`Response::body_string()`] was added to retrieve the response body as a
`String`.
* [`Response::body_bytes()`] was added to retrieve the response body as a
`Vec<u8>`.
* [`Response::content_type()`] was added to easily retrieve the Content-Type
header of a response.
* Size limits on incoming data are [now
configurable](https://rocket.rs/v0.3/guide/configuration/#data-limits).
* [`Request::limits()`] was added to retrieve incoming data limits.
* Responders may dynamically adjust their response based on the incoming
request.
* [`Request::guard()`] was added for simple retrieval of request guards.
* [`Request::route()`] was added to retrieve the active route, if any.
* `&Route` is now a request guard.
* The base mount path of a [`Route`] can be retrieved via `Route::base` or
`Route::base()`.
* [`Cookies`] supports _private_ (authenticated encryption) cookies, encrypted
with the `secret_key` config key.
* `Config::{development, staging, production}` constructors were added for
[`Config`].
* [`Config::get_datetime()`] was added to retrieve an extra as a `Datetime`.
* Forms can be now parsed _leniently_ via the new [`LenientForm`] data guard.
* The `?` operator can now be used with `Outcome`.
* Quoted string, array, and table based [configuration parameters] can be set
via environment variables.
* Log coloring is disabled when `stdout` is not a TTY.
* [`FromForm`] is implemented for `Option<T: FromForm>`, `Result<T: FromForm,
T::Error>`.
* The [`NotFound`] responder was added for simple **404** response
construction.
[Fairings]: https://rocket.rs/v0.3/guide/fairings/
[Native TLS support]: https://rocket.rs/v0.3/guide/configuration/#configuring-tls
[Private cookies]: https://rocket.rs/v0.3/guide/requests/#private-cookies
[can be renamed]: https://rocket.rs/v0.3/guide/requests/#field-renaming
[`MsgPack`]: https://api.rocket.rs/v0.3/rocket_contrib/struct.MsgPack.html
[`Rocket::launch()`]: https://api.rocket.rs/v0.3/rocket/struct.Rocket.html#method.launch
[`LaunchError`]: https://api.rocket.rs/v0.3/rocket/error/struct.LaunchError.html
[Default rankings]: https://api.rocket.rs/v0.3/rocket/struct.Route.html
[`Route`]: https://api.rocket.rs/v0.3/rocket/struct.Route.html
[`Accept`]: https://api.rocket.rs/v0.3/rocket/http/struct.Accept.html
[`Request::accept()`]: https://api.rocket.rs/v0.3/rocket/struct.Request.html#method.accept
[`contrib`]: https://api.rocket.rs/v0.3/rocket_contrib/
[`Rocket::routes()`]: https://api.rocket.rs/v0.3/rocket/struct.Rocket.html#method.routes
[`Response::body_string()`]: https://api.rocket.rs/v0.3/rocket/struct.Response.html#method.body_string
[`Response::body_bytes()`]: https://api.rocket.rs/v0.3/rocket/struct.Response.html#method.body_bytes
[`Response::content_type()`]: https://api.rocket.rs/v0.3/rocket/struct.Response.html#method.content_type
[`Request::guard()`]: https://api.rocket.rs/v0.3/rocket/struct.Request.html#method.guard
[`Request::limits()`]: https://api.rocket.rs/v0.3/rocket/struct.Request.html#method.limits
[`Request::route()`]: https://api.rocket.rs/v0.3/rocket/struct.Request.html#method.route
[`Config`]: https://api.rocket.rs/v0.3/rocket/struct.Config.html
[`Cookies`]: https://api.rocket.rs/v0.3/rocket/http/enum.Cookies.html
[`Config::get_datetime()`]: https://api.rocket.rs/v0.3/rocket/struct.Config.html#method.get_datetime
[`LenientForm`]: https://api.rocket.rs/v0.3/rocket/request/struct.LenientForm.html
[configuration parameters]: https://api.rocket.rs/v0.3/rocket/config/index.html#environment-variables
[`NotFound`]: https://api.rocket.rs/v0.3/rocket/response/status/struct.NotFound.html
## Breaking Changes
This release includes many breaking changes. These changes are listed below
along with a short note about how to handle the breaking change in existing
applications.
* **`session_key` was renamed to `secret_key`, requires a 256-bit base64 key**
It's unlikely that `session_key` was previously used. If it was, rename
`session_key` to `secret_key`. Generate a random 256-bit base64 key using a
tool like openssl: `openssl rand -base64 32`.
* **The `&Cookies` request guard has been removed in favor of `Cookies`**
Change `&Cookies` in a request guard position to `Cookies`.
* **`Rocket::launch()` now returns a `LaunchError`, doesn't panic.**
For the old behavior, suffix a call to `.launch()` with a semicolon:
`.launch();`.
* **Routes without query parameters match requests with or without query
parameters.**
There is no workaround, but this change may allow manual ranks from routes
to be removed.
* **The `format` route attribute on non-payload requests matches against the
Accept header.**
Excepting a custom request guard, there is no workaround. Previously,
`format` always matched against the Content-Type header, regardless of
whether the request method indicated a payload or not.
* **A type of `&str` can no longer be used in form structures or parameters.**
Use the new [`&RawStr`] type instead.
* **`ContentType` is no longer a request guard.**
Use `&ContentType` instead.
* **`Request::content_type()` returns `&ContentType` instead of
`ContentType`.**
Use `.clone()` on `&ContentType` if a type of `ContentType` is required.
* **`Response::header_values()` was removed. `Response::headers()` now returns
an `&HeaderMap`.**
A call to `Response::headers()` can be replaced with
`Response::headers().iter()`. A call to `Response::header_values(name)` can
be replaced with `Response::headers().get(name)`.
* **Route collisions result in a hard error and panic.**
There is no workaround. Previously, route collisions were a warning.
* **The [`IntoOutcome`] trait has been expanded and made more flexible.**
There is no workaround. `IntoOutcome::into_outcome()` now takes a `Failure`
value to use. `IntoOutcome::or_forward()` was added to return a `Forward`
outcome if `self` indicates an error.
* **The 'testing' feature was removed.**
Remove `features = ["testing"]` from `Cargo.toml`. Use the new [`local`]
module for testing.
* **`serde` was updated to 1.0.**
There is no workaround. Ensure all dependencies rely on `serde` `1.0`.
* **`config::active()` was removed.**
Use [`Rocket::config()`] to retrieve the configuration before launch. If
needed, use [managed state] to store config information for later use.
* **The [`Responder`] trait has changed.**
`Responder::respond(self)` was removed in favor of
`Responder::respond_to(self, &Request)`. Responders may dynamically adjust
their response based on the incoming request.
* **`Outcome::of(Responder)` was removed while `Outcome::from(&Request,
Responder)` was added.**
Use `Outcome::from(..)` instead of `Outcome::of(..)`.
* **Usage of templates requires `Template::fairing()` to be attached.**
Call `.attach(Template::fairing())` on the application's Rocket instance
before launching.
* **The `Display` implementation of `Template` was removed.**
Use [`Template::show()`] to render a template directly.
* **`Request::new()` is no longer exported.**
There is no workaround.
* **The [`FromForm`] trait has changed.**
`Responder::from_form_items(&mut FormItems)` was removed in favor of
`Responder::from_form(&mut FormItems, bool)`. The second parameter indicates
whether parsing should be strict (if `true`) or lenient (if `false`).
* **`LoggingLevel` was removed as a root reexport.**
It can now be imported from `rocket::config::LoggingLevel`.
* **An `Io` variant was added to [`ConfigError`].**
Ensure `match`es on `ConfigError` include an `Io` variant.
* **[`ContentType::from_extension()`] returns an `Option<ContentType>`.**
For the old behavior, use `.unwrap_or(ContentType::Any)`.
* **The `IntoValue` config trait was removed in favor of `Into<Value>`.**
There is no workaround. Use `Into<Value>` as necessary.
* **The `rocket_contrib::JSON` type has been renamed to
[`rocket_contrib::Json`].**
Use `Json` instead of `JSON`.
* **All structs in the [`content`] module use TitleCase names.**
Use `Json`, `Xml`, `Html`, and `Css` instead of `JSON`, `XML`, `HTML`, and
`CSS`, respectively.
[`&RawStr`]: https://api.rocket.rs/v0.3/rocket/http/struct.RawStr.html
[`IntoOutcome`]: https://api.rocket.rs/v0.3/rocket/outcome/trait.IntoOutcome.html
[`local`]: https://api.rocket.rs/v0.3/rocket/local/index.html
[`Rocket::config()`]: https://api.rocket.rs/v0.3/rocket/struct.Rocket.html#method.config
[managed state]: https://rocket.rs/v0.3/guide/state/
[`Responder`]: https://api.rocket.rs/v0.3/rocket/response/trait.Responder.html
[`Template::show()`]: https://api.rocket.rs/v0.3/rocket_contrib/struct.Template.html#method.show
[`FromForm`]: https://api.rocket.rs/v0.3/rocket/request/trait.FromForm.html
[`ConfigError`]: https://api.rocket.rs/v0.3/rocket/config/enum.ConfigError.html
[`ContentType::from_extension()`]: https://api.rocket.rs/v0.3/rocket/http/struct.ContentType.html#method.from_extension
[`rocket_contrib::Json`]: https://api.rocket.rs/v0.3/rocket_contrib/struct.Json.html
[`content`]: https://api.rocket.rs/v0.3/rocket/response/content/index.html
## General Improvements
In addition to new features, Rocket saw the following improvements:
* "Rocket" is now capitalized in the `Server` HTTP header.
* The generic parameter of `rocket_contrib::Json` defaults to `json::Value`.
* The trailing '...' in the launch message was removed.
* The launch message prints regardless of the config environment.
* For debugging, `FromData` is implemented for `Vec<u8>` and `String`.
* The port displayed on launch is the port resolved, not the one configured.
* The `uuid` dependency was updated to `0.5`.
* The `base64` dependency was updated to `0.6`.
* The `toml` dependency was updated to `0.4`.
* The `handlebars` dependency was updated to `0.27`.
* The `tera` dependency was updated to `0.10`.
* [`yansi`] is now used for all terminal coloring.
* The `dev` `rustc` release channel is supported during builds.
* [`Config`] is now exported from the root.
* [`Request`] implements `Clone` and `Debug`.
* The `workers` config parameter now defaults to `num_cpus * 2`.
* Console logging for table-based config values is improved.
* `PartialOrd`, `Ord`, and `Hash` are now implemented for [`State`].
* The format of a request is always logged when available.
* Route matching on `format` now functions as documented.
[`yansi`]: https://crates.io/crates/yansi
[`Request`]: https://api.rocket.rs/v0.3/rocket/struct.Request.html
[`State`]: https://api.rocket.rs/v0.3/rocket/struct.State.html
## Infrastructure
* All examples include a test suite.
* The `master` branch now uses a `-dev` version number.
# Version 0.2.8 (Jun 01, 2017)
## Codegen
* Lints were updated for `2017-06-01` nightly.
* Minimum required `rustc` is `1.19.0-nightly (2017-06-01)`.
# Version 0.2.7 (May 26, 2017)
## Codegen
* Codegen was updated for `2017-05-26` nightly.
# Version 0.2.6 (Apr 17, 2017)
## Codegen
* Allow `k` and `v` to be used as fields in `FromForm` structures by avoiding
identifier collisions ([#265]).
[#265]: https://github.com/rwf2/Rocket/issues/265
# Version 0.2.5 (Apr 16, 2017)
## Codegen
* Lints were updated for `2017-04-15` nightly.
* Minimum required `rustc` is `1.18.0-nightly (2017-04-15)`.
# Version 0.2.4 (Mar 30, 2017)
## Codegen
* Codegen was updated for `2017-03-30` nightly.
* Minimum required `rustc` is `1.18.0-nightly (2017-03-30)`.
# Version 0.2.3 (Mar 22, 2017)
## Fixes
* Multiple header values for the same header name are now properly preserved
(#223).
## Core
* The `get_slice` and `get_table` methods were added to `Config`.
* The `pub_restricted` feature has been stabilized!
## Codegen
* Lints were updated for `2017-03-20` nightly.
* Minimum required `rustc` is `1.17.0-nightly (2017-03-22)`.
## Infrastructure
* The test script now denies trailing whitespace.
# Version 0.2.2 (Feb 26, 2017)
## Codegen
* Lints were updated for `2017-02-25` and `2017-02-26` nightlies.
* Minimum required `rustc` is `1.17.0-nightly (2017-02-26)`.
# Version 0.2.1 (Feb 24, 2017)
## Core Fixes
* `Flash` cookie deletion functions as expected regardless of the path.
* `config` properly accepts IPv6 addresses.
* Multiple `Set-Cookie` headers are properly set.
## Core Improvements
* `Display` and `Error` were implemented for `ConfigError`.
* `webp`, `ttf`, `otf`, `woff`, and `woff2` were added as known content types.
* Routes are presorted for faster routing.
* `into_bytes` and `into_inner` methods were added to `Body`.
## Codegen
* Fixed `unmanaged_state` lint so that it works with prefilled type aliases.
## Contrib
* Better errors are emitted on Tera template parse errors.
## Documentation
* Fixed typos in `manage` and `JSON` docs.
## Infrastructure
* Updated doctests for latest Cargo nightly.
# Version 0.2.0 (Feb 06, 2017)
Detailed release notes for v0.2 can also be found on
[rocket.rs](https://rocket.rs/v0.3/news/2017-02-06-version-0.2/).
## New Features
This release includes the following new features:
* Introduced managed state.
* Added lints that warn on unmanaged state and unmounted routes.
* Added the ability to set configuration parameters via environment variables.
* `Config` structures can be built via `ConfigBuilder`, which follows the
builder pattern.
* Logging can be enabled or disabled on custom configuration via a second
parameter to the `Rocket::custom` method.
* `name` and `value` methods were added to `Header` to retrieve the name and
value of a header.
* A new configuration parameter, `workers`, can be used to set the number of
threads Rocket uses.
* The address of the remote connection is available via `Request.remote()`.
Request preprocessing overrides remote IP with value from the `X-Real-IP`
header, if present.
* During testing, the remote address can be set via `MockRequest.remote()`.
* The `SocketAddr` request guard retrieves the remote address.
* A `UUID` type has been added to `contrib`.
* `rocket` and `rocket_codegen` will refuse to build with an incompatible
nightly version and emit nice error messages.
* Major performance and usability improvements were upstreamed to the `cookie`
crate, including the addition of a `CookieBuilder`.
* When a checkbox isn't present in a form, `bool` types in a `FromForm`
structure will parse as `false`.
* The `FormItems` iterator can be queried for a complete parse via `completed`
and `exhausted`.
* Routes for `OPTIONS` requests can be declared via the `options` decorator.
* Strings can be percent-encoded via `URI::percent_encode()`.
## Breaking Changes
This release includes several breaking changes. These changes are listed below
along with a short note about how to handle the breaking change in existing
applications.
* **`Rocket::custom` takes two parameters, the first being `Config` by
value.**
A call in v0.1 of the form `Rocket::custom(&config)` is now
`Rocket::custom(config, false)`.
* **Tera templates are named without their extension.**
A templated named `name.html.tera` is now simply `name`.
* **`JSON` `unwrap` method has been renamed to `into_inner`.**
A call to `.unwrap()` should be changed to `.into_inner()`.
* **The `map!` macro was removed in favor of the `json!` macro.**
A call of the form `map!{ "a" => b }` can be written as: `json!({ "a": b
})`.
* **The `hyper::SetCookie` header is no longer exported.**
Use the `Cookie` type as an `Into<Header>` type directly.
* **The `Content-Type` for `String` is now `text/plain`.**
Use `content::HTML<String>` for HTML-based `String` responses.
* **`Request.content_type()` returns an `Option<ContentType>`.**
Use `.unwrap_or(ContentType::Any)` to get the old behavior.
* **The `ContentType` request guard forwards when the request has no
`Content-Type` header.**
Use an `Option<ContentType>` and `.unwrap_or(ContentType::Any)` for the old
behavior.
* **A `Rocket` instance must be declared _before_ a `MockRequest`.**
Change the order of the `rocket::ignite()` and `MockRequest::new()` calls.
* **A route with `format` specified only matches requests with the same
format.**
Previously, a route with a `format` would match requests without a format
specified. There is no workaround to this change; simply specify formats
when required.
* **`FormItems` can no longer be constructed directly.**
Instead of constructing as `FormItems(string)`, construct as
`FormItems::from(string)`.
* **`from_from_string(&str)` in `FromForm` removed in favor of
`from_form_items(&mut FormItems)`.**
Most implementation should be using `FormItems` internally; simply use the
passed in `FormItems`. In other cases, the form string can be retrieved via
the `inner_str` method of `FormItems`.
* **`Config::{set, default_for}` are deprecated.**
Use the `set_{param}` methods instead of `set`, and `new` or `build` in
place of `default_for`.
* **Route paths must be absolute.**
Prepend a `/` to convert a relative path into an absolute one.
* **Route paths cannot contain empty segments.**
Remove any empty segments, including trailing ones, from a route path.
## Bug Fixes
A couple of bugs were fixed in this release:
* Handlebars partials were not properly registered
([#122](https://github.com/rwf2/Rocket/issues/122)).
* `Rocket::custom` did not set the custom configuration as the `active`
configuration.
* Route path segments containing more than one dynamic parameter were
allowed.
## General Improvements
In addition to new features, Rocket saw the following smaller improvements:
* Rocket no longer overwrites a catcher's response status.
* The `port` `Config` type is now a proper `u16`.
* Clippy issues injected by codegen are resolved.
* Handlebars was updated to `0.25`.
* The `PartialEq` implementation of `Config` doesn't consider the path or
secret key.
* Hyper dependency updated to `0.10`.
* The `Error` type for `JSON as FromData` has been exposed as `SerdeError`.
* SVG was added as a known Content-Type.
* Serde was updated to `0.9`.
* Form parse failure now results in a **422** error code.
* Tera has been updated to `0.7`.
* `pub(crate)` is used throughout to enforce visibility rules.
* Query parameters in routes (`/path?<param>`) are now logged.
* Routes with and without query parameters no longer _collide_.
## Infrastructure
* Testing was parallelized, resulting in 3x faster Travis builds.
# Version 0.1.6 (Jan 26, 2017)
## Infrastructure
* Hyper version pinned to 0.9.14 due to upstream non-semver breaking change.
# Version 0.1.5 (Jan 14, 2017)
## Core
* Fixed security checks in `FromSegments` implementation for `PathBuf`.
## Infrastructure
* `proc_macro` feature removed from examples due to stability.
# Version 0.1.4 (Jan 4, 2017)
## Core
* Header names are treated as case-preserving.
## Codegen
* Minimum supported nightly is `2017-01-03`.
# Version 0.1.3 (Dec 31, 2016)
## Core
* Typo in `Outcome` formatting fixed (Succcess -> Success).
* Added `ContentType::CSV`.
* Dynamic segments parameters are properly resolved, even when mounted.
* Request methods are only overridden via `_method` field on POST.
* Form value `String`s are properly decoded.
## Codegen
* The `_method` field is now properly ignored in `FromForm` derivation.
* Unknown Content-Types in `format` no longer result in an error.
* Deriving `FromForm` no longer results in a deprecation warning.
* Codegen will refuse to build with incompatible rustc, presenting error
message and suggestion.
* Added `head` as a valid decorator for `HEAD` requests.
* Added `route(OPTIONS)` as a valid decorator for `OPTIONS` requests.
## Contrib
* Templates with the `.tera` extension are properly autoescaped.
* Nested template names are properly resolved on Windows.
* Template implements `Display`.
* Tera dependency updated to version 0.6.
## Docs
* Todo example requirements clarified in its `README`.
## Testing
* Tests added for `config`, `optional_result`, `optional_redirect`, and
`query_params` examples.
* Testing script checks for and disallows tab characters.
## Infrastructure
* New script (`bump_version.sh`) automates version bumps.
* Config script emits error when readlink/readpath support is bad.
* Travis badge points to public builds.
# Version 0.1.2 (Dec 24, 2016)
## Codegen
* Fix `get_raw_segments` index argument in route codegen
([#41](https://github.com/rwf2/Rocket/issues/41)).
* Segments params (`<param..>`) respect prefixes.
## Contrib
* Fix nested template name resolution
([#42](https://github.com/rwf2/Rocket/issues/42)).
## Infrastructure
* New script (`publish.sh`) automates publishing to crates.io.
* New script (`bump_version.sh`) automates version bumps.
# Version 0.1.1 (Dec 23, 2016)
## Core
* `NamedFile` `Responder` lost its body in the shuffle; it's back!
# Version 0.1.0 (Dec 23, 2016)
This is the first public release of Rocket!
## Breaking
All of the mentions to `hyper` types in core Rocket types are no more. Rocket
now implements its own `Request` and `Response` types.
* `ContentType` uses associated constants instead of static methods.
* `StatusCode` removed in favor of new `Status` type.
* `Response` type alias superseded by `Response` type.
* `Responder::respond` no longer takes in hyper type.
* `Responder::respond` returns `Response`, takes `self` by move.
* `Handler` returns `Outcome` instead of `Response` type alias.
* `ErrorHandler` returns `Result`.
* All `Hyper*` types were moved to unprefixed versions in `hyper::`.
* `MockRequest::dispatch` now returns a `Response` type.
* `URIBuf` removed in favor of unified `URI`.
* Rocket panics when an illegal, dynamic mount point is used.
## Core
* Rocket handles `HEAD` requests automatically.
* New `Response` and `ResponseBuilder` types.
* New `Request`, `Header`, `Status`, and `ContentType` types.
## Testing
* `MockRequest` allows any type of header.
* `MockRequest` allows cookies.
## Codegen
* Debug output disabled by default.
* The `ROCKET_CODEGEN_DEBUG` environment variables enables codegen logging.
# Version 0.0.11 (Dec 11, 2016)
## Streaming Requests
All incoming request data is now streamed. This resulted in a major change to
the Rocket APIs. They are summarized through the following API changes:
* The `form` route parameter has been removed.
* The `data` route parameter has been introduced.
* Forms are now handled via the `data` parameter and `Form` type.
* Removed the `data` parameter from `Request`.
* Added `FromData` conversion trait and default implementation.
* `FromData` is used to automatically derive the `data` parameter.
* `Responder`s are now final: they cannot forward to other requests.
* `Responder`s may only forward to catchers.
## Breaking
* Request `uri` parameter is private. Use `uri()` method instead.
* `form` module moved under `request` module.
* `response::data` was renamed to `response::content`.
* Introduced `Outcome` with `Success`, `Failure`, and `Forward` variants.
* `outcome` module moved to top-level.
* `Response` is now a type alias to `Outcome`.
* `Empty` `Responder` was removed.
* `StatusResponder` removed in favor of `response::status` module.
## Codegen
* Error handlers can now take 0, 1, or 2 parameters.
* `FromForm` derive now works on empty structs.
* Lifetimes are now properly stripped in code generation.
* Any valid ident is now allowed in single-parameter route parameters.
## Core
* Route is now cloneable.
* `Request` no longer has any lifetime parameters.
* `Handler` type now includes a `Data` parameter.
* `http` module is public.
* `Responder` implemented for `()` type as an empty response.
* Add `config::get()` for global config access.
* Introduced `testing` module.
* `Rocket.toml` allows global configuration via `[global]` table.
## Docs
* Added a `raw_upload` example.
* Added a `pastebin` example.
* Documented all public APIs.
## Testing
* Now building and running tests with `--all-features` flag.
* Added appveyor config for Windows CI testing.
# Version 0.0.10 (Oct 03, 2016)
## Breaking
* Remove `Rocket::new` in favor of `ignite` method.
* Remove `Rocket::mount_and_launch` in favor of chaining `mount(..).launch()`.
* `mount` and `catch` take `Rocket` type by value.
* All types related to HTTP have been moved into `http` module.
* `Template::render` in `contrib` now takes context by reference.
## Core
* Rocket now parses option `Rocket.toml` for configuration, defaulting to sane
values.
* `ROCKET_ENV` environment variable can be used to specify running environment.
## Docs
* Document `ContentType`.
* Document `Request`.
* Add script that builds docs.
## Testing
* Scripts can now be run from any directory.
* Cache Cargo directories in Travis for faster testing.
* Check that library version numbers match in testing script.
# Version 0.0.9 (Sep 29, 2016)
## Breaking
* Rename `response::data_type` to `response::data`.
## Core
* Rocket interprets `_method` field in forms as the incoming request's method.
* Add `Outcome::Bad` to signify responses that failed internally.
* Add a `NamedFile` `Responder` type that uses a file's extension for the
response's content type.
* Add a `Stream` `Responder` for streaming responses.
## Contrib
* Introduce the `contrib` crate.
* Add JSON support via `JSON`, which implements `FromRequest` and `Responder`.
* Add templating support via `Template` which implements `Responder`.
## Docs
* Initial guide-like documentation.
* Add documentation, testing, and contributing sections to README.
## Testing
* Add a significant number of codegen tests.
================================================
FILE: CONTRIBUTING.md
================================================
# Contributing to Rocket
**Please read this document before contributing!**
Thank you for contributing! We welcome your contributions in whichever form they
may come.
This document provides guidelines and resources to help you successfully
contribute to the project. Rocket is a tool designed to push the envelope of
usability, security, _and_ performance in web frameworks, and accordingly, our
quality standards are high. To make the best use of everyone's time and avoid
wasted efforts, take a moment to understand our expectations and conventions
outlined here.
## Submitting Pull Requests
Before creating a new pull request:
* Read and understand [Code Style Conventions], [Commit Message Guidelines],
and [Testing].
* If you're resolving an open issue, follow [Resolving an Open Issue].
* If you're implementing new functionality, check whether the functionality
you're implementing has been proposed before, either as an [issue] or [pull
request]. Ensure your PR resolves any previously raised concerns. Then,
follow [Implementing an Unproposed Feature].
* For everything else, see [Other Common Contributions].
We aim to keep Rocket's code quality at the highest level. This means that any
code you contribute must be:
* **Commented:** Complex or subtle functionality must be properly commented.
* **Documented:** Public items must have doc comments with examples.
* **Styled:** Your code must follow the [Code Style Conventions].
* **Simple:** Your code should accomplish its task as simply and
idiomatically as possible.
* **Tested:** You must write (and pass) convincing [tests](#testing) for all
new or changed functionality.
* **Focused:** Your code should do what it's supposed to and nothing more.
### Resolving an Open Issue
[Resolving an Open Issue]: #resolving-an-open-issue
If you spot an open issue that you'd like to resolve:
1. **First identify if there's a proposed solution to the problem.**
If there is, proceed to step 2. If there isn't, your first course of
action, before writing any code, is to propose a solution. To do so, leave
a comment describing your solution in the relevant issue. It's especially
useful to see test cases and hypothetical examples. This step is critical:
it allows us to identify and resolve concerns with a proposed solution
before anyone spends time writing code. It may also allow us to point you
in more efficient implementation directions.
2. **Write a failing test case you expect to pass after resolving the issue.**
If you can write proper tests cases that fail, do so (see [Testing]). If
you cannot, for instance because you're introducing new APIs which can't be
used until they exist, write a test case that mocks usage of those APIs. In
either case, allow the tests and mock examples to guide your progress.
3. **Write basic functionality, pass tests, and submit a PR.**
Think about edge cases to the problem and ensure you have tests for those
edge cases. Once your implementation is functionally complete, submit a PR.
Don't spend time writing or changing a bunch of documentation just yet.
4. **Wait for a review, iterate, and polish.**
If a review doesn't come in a few days, feel free to ping a maintainer.
Once someone reviews your PR, integrate their feedback. If the PR solves the
issue (which it should because you have passing tests) and fits the project
(which it should since you sought feedback _before_ submitting), it will be
_conditionally_ approved pending final polish: documentation (rustdocs,
guide docs), style improvements, and testing. Your PR will then be merged.
### Implementing an Unproposed Feature
[Implementing an Unproposed Feature]: #implementing-an-unproposed-feature
First and foremost, **please do not submit a PR that implements a new feature
without first proposing a design and seeking feedback.** We take the addition of
new features _very_ seriously because they directly impact usability.
To propose a new feature, create a [new feature request issue] and follow the
template. Note that certain classes of features require particularly compelling
justification to be taken into consideration. These include features that:
* Can be implemented outside of Rocket.
* Introduce new dependencies, especially heavier ones.
* Only exist to add support for an external crate.
* Are too specific to one use-case.
* Are overtly complex _and_ have "simple" workarounds.
* Only partially solve a bigger deficiency.
Once your feature request is accepted, follow [Resolving an Open Issue].
[new feature request issue]: https://github.com/rwf2/Rocket/issues/new?assignees=&labels=request&projects=&template=feature-request.yml
### Other Common Contributions
[Other Common Contributions]: #other-common-contributions
* **Doc fixes, typos, wording improvements.**
We encourage any of these! Just a submit a PR with your changes. Please
preserve the surrounding markdown formatting as much as possible. This
typically means keeping lines under 80 characters, keeping table delimiters
aligned, and preserving indentation accordingly.
The guide's source files are at [docs/guide]. Note the following special
syntax available in guide markdown:
- **Cross-linking** pages is accomplished via relative links. Outside
of the index, this is: `../{page}#anchor`. For instance, to link to
**Quickstart > Running Examples**, use `../quickstart#running-examples`.
- **Aliases** are shorthand URLs that start with `@` (e.g, `@api`). They are
used throughout the guide to simplify creating versioned URLs. They are
replaced at build time with the appropriate versioned instance.
* **New examples or changes to existing ones.**
Please follow the [Implementing an Unproposed Feature] process.
* **Formatting or other purely cosmetic changes.**
We generally do not accept purely cosmetic changes to the codebase such as
style or formatting changes. All PRs must add something substantial to
Rocket's functionality, coherence, testing, performance, usability, bug
fixes, security, documentation, or overall maintainability.
* **Advertisements of any nature.**
We do not accept any contributions that resemble advertisements or
promotional content. If you are interested in supporting Rocket, we
encourage you to [sponsor the project].
## Testing
[Testing]: #testing
All testing happens through [test.sh]. Before submitting a PR, run the script
and fix any issues. The default mode (passing no arguments or `--default`) will
usually suffice, but you may also wish to execute additional tests. In
particular:
* If you make changes to `contrib`: `test.sh --contrib`
* If you make user-facing API changes or update deps: `test.sh --examples`
* If you add or modify feature flags: `test.sh --core`
* If you modify codegen: see [UI Tests].
Run `test.sh --help` to get an overview of how to execute the script:
```sh
USAGE:
./scripts/test.sh [+<TOOLCHAIN>] [--help|-h] [--<TEST>]
OPTIONS:
+<TOOLCHAIN> Forwarded to Cargo to select toolchain.
--help, -h Print this help message and exit.
--<TEST> Run the specified test suite.
(Run without --<TEST> to run default tests.)
AVAILABLE <TEST> OPTIONS:
default
all
core
contrib
examples
benchmarks
testbench
ui
EXAMPLES:
./scripts/test.sh # Run default tests on current toolchain.
./scripts/test.sh +stable --all # Run all tests on stable toolchain.
./scripts/test.sh --ui # Run UI tests on current toolchain.
```
### Writing Tests
Rocket is tested in a variety of ways. This includes via Rust's regular testing
facilities such as doctests, unit tests, and integration tests, as well Rocket's
examples, testbench, and [UI Tests]:
- **Examples**: The [`examples`](examples/) directory contains applications
that make use of many of Rocket's features. Each example is integration
tested using Rocket's built-in [local testing]. This both ensures that
typical Rocket code continues to work as expected and serves as a way to
detect and resolve user-facing breaking changes.
- **Testbench**: Rocket's [testbench](testbench/) tests end-to-end server or
protocol properties by starting up full Rocket servers to which it
dispatches real HTTP requests. Each server is independently written in
[testbench/src/servers/](testbench/src/servers/). You're unlikely to need to
write a testbench test unless you're modifying low-level details.
- **UI Tests**: UI tests ensure Rocket's codegen produces meaningful compiler
diagnostics. They compile Rocket applications and compare the compiler's
output to expected results. If you're changing codegen, you'll need to
update or create UI tests. See [UI Tests] for details.
For any change that affects functionality, we ask that you write a test that
verifies that functionality. Minimally, this means a unit test, doctest,
integration test, or some combination of these. For small changes, unit tests
will likely suffice. If the change affects the user in any way, then doctests
should be added or modified. And if the change requires using unrelated APIs to
test, then an integration test should be added.
Additionally, the following scenarios require special attention:
- **Improved Features**
Modifying an existing example is a great place to write tests for improved
features. If you do modify an example, make sure you modify the README in
the example directory, too.
- **New Features**
For major features, introducing a new example that showcases idiomatic use
of the feature can be useful. Make sure you modify the README in the
`examples` directory if you do. In addition, all newly introduced public
APIs should be fully documented and include doctests as well as unit and
integration tests.
- **Fixing a Bug**
To avoid regressions, _always_ introduce or modify an integration or
testbench test for a bugfix. Integration tests should live in the usual
`tests/` directory and be named `short-issue-description-NNNN.rs`, where
`NNNN` is the GitHub issue number for the bug. For example,
`forward-includes-status-1560.rs`.
[local testing]: https://api.rocket.rs/master/rocket/local/
### UI Tests
[UI Tests]: #ui-tests
Changes to codegen (i.e, `rocket_codegen` and other `_codegen` crates)
necessitate adding and running UI tests, which capture compiler output and
compare it against some expected output. UI tests use [`trybuild`].
Tests can be found in the `codegen/tests/ui-fail` directories of respective
`codegen` crates. Each test is symlinked into sibling `ui-fail-stable` and
`ui-fail-nightly` directories, which also contain the expected error output for
stable and nightly compilers, respectively. For example:
```
./core/codegen/tests
├── ui-fail
│ ├── async-entry.rs
│ ├── ...
│ └── uri_display_type_errors.rs
├── ui-fail-nightly
│ ├── async-entry.rs -> ../ui-fail/async-entry.rs
│ ├── async-entry.stderr
│ ├── ...
│ ├── uri_display_type_errors.rs -> ../ui-fail/uri_display_type_errors.rs
│ └── uri_display_type_errors.stderr
└── ui-fail-stable
├── async-entry.rs -> ../ui-fail/async-entry.rs
├── async-entry.stderr
├── ...
├── uri_display_type_errors.rs -> ../ui-fail/uri_display_type_errors.rs
└── uri_display_type_errors.stderr
```
If you make changes to codegen, run the UI tests for stable and nightly with
`test.sh +stable --ui` and `test.sh +nightly --ui`. If there are failures,
update the outputs with `TRYBUILD=overwrite test.sh +nightly --ui` and
`TRYBUILD=overwrite test.sh +stable --ui`. Look at the diff to see what's
changed. Ensure that error messages properly attribute (i.e., visually underline
or point to) the source of the error. For example, if a type need to implement a
trait, then that type should be underlined. We strive to emit the most helpful
and descriptive error messages possible.
### API Docs
If you make changes to documentation, you should build the API docs and verify
that your changes look as you expect. API documentation is built with
[mk-docs.sh] and output to the usual `target/docs` directory. By default, the
script will `clean` any existing docs to avoid potential caching issues. To
override this behavior, use `mk-docs.sh -d`.
## Code Style Conventions
[Code Style Conventions]: #code-style-conventions
We _do not_ use `rustfmt` or `cargo fmt` due to bugs and missing functionality.
Instead, we ask that you follow the [Rust Style Guide] with the following
changes:
**Always separate items with one blank line.**
<table>
<thead>
<tr>
<th width="350px"><b>✅ Yes</b></th>
<th width="350px"><b>No 🚫</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>
```rust
fn foo() {
// ..
}
fn bar() {
// ..
}
```
</td>
<td>
```rust
fn foo() {
// ..
}
fn bar() {
// ..
}
```
</td>
</tr>
</tbody>
</table>
**Prefer a where-clause over block-indented generics.**
<table>
<thead>
<tr>
<th width="350px"><b>✅ Yes</b></th>
<th width="350px"><b>No 🚫</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>
```rust
fn foo<T, U>(x: Vec<T>, y: Vec<U>)
where T: Display, U: Debug
{
// ..
}
```
</td>
<td>
```rust
fn foo<
T: Display,
U: Debug,
>(x: Vec<T>, y: Vec<U>) {
// ..
}
```
</td>
</tr>
</tbody>
</table>
**For "short" where-clauses, follow Rust guidelines. For "long" where-clauses,
block-indent `where`, place the first bound on the same line as `where`, and
block-align the remaining bounds.**
<table>
<thead>
<tr>
<th width="350px"><b>✅ Yes</b></th>
<th width="350px"><b>No 🚫</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>
```rust
fn foo<T, F, Item, G>(v: Foo<T, F, Item>) -> G
where T: for<'x> SomeTrait<'x>
F: Fn(Item) -> G,
Item: Display + Debug,
G: Error,
{
// ..
}
```
</td>
<td>
```rust
fn foo<T, F, Item, G>(v: Foo<T, F, Item>) -> G
where
T: for<'x> SomeTrait<'x>
F: Fn(Item) -> G,
Item: Display + Debug,
G: Error,
{
// ..
}
```
</td>
</tr>
</tbody>
</table>
**Do not use multi-line imports. Use multiple lines grouped by import kind if
possible.**
<table>
<thead>
<tr>
<th width="350px"><b>✅ Yes</b></th>
<th width="350px"><b>No 🚫</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>
```rust
use foo::{Long, List, Of, Type, Imports};
use foo::{some_macro, imports};
```
</td>
<td>
```rust
use foo::{
Long, List, Of, Type, Imports,
some_macro, imports,
};
```
</td>
</tr>
</tbody>
</table>
**Order imports in order of decreasing "distance" to the current module: `std`,
`core`, and `alloc`, external crates, then current crate. Prefer using `crate`
relative imports to `super`. Separate each category with one blank line.**
<table>
<thead>
<tr>
<th width="350px"><b>✅ Yes</b></th>
<th width="350px"><b>No 🚫</b></th>
</tr>
</thead>
<tbody>
<tr>
<td>
```rust
use std::{foo, bar};
use alloc::{bar, baz};
use either::Either;
use futures::{SomeItem, OtherItem};
use crate::{item1, item2};
use crate::module::item3;
use crate::module2::item4;
```
</td>
<td>
```rust
use crate::{item1, item2};
use std::{foo, bar};
use either::Either;
use alloc::{bar, baz};
use futures::{SomeItem, OtherItem};
use super::{item3, item4};
use super::item4;
```
</td>
</tr>
</tbody>
</table>
## Commit Message Guidelines
[Commit Message Guidelines]: #commit-message-guidelines
Git commit messages should start with a single-line _header_ of at most 50
characters followed by a body with any number of descriptive paragraphs, with
lines not to exceed 72 characters, and a footer.
The **header** must be an imperative statement that precisely describes the
primary change made by the commit. The goal is to give the reader a good
understanding of what the commit does via only the header. It should not require
context to understand. It should not include references to git commits or
issues. Avoid using Markdown in the header if possible.
Typically, the first word in the header will be one of the following:
* **Fix** - to fix a functional or doc bug
- Example: `Fix 'TcpListener': allow 'udp://' prefix.`
* **Improve** - for minor feature or doc improvements
- Example: `Improve 'FromParam' derive error messages.`
* **Introduce** - for major feature introductions
- Example: `Introduce WebSocket support.`
* **Add**, **Remove** - for changes
- Example: `Add 'Foo::new()' constructor.`
- Example: `Remove 'Foo::new()'; add 'Foo::build()'.`
* **Update** - for crate updates
- Example: `Update 'base64' to 0.12.`
* **Impl** or **Implement** - for trait implementations
- Example: `Implement 'FromForm' for 'ThisNewType'.`
Note how generic words like "change" are avoided, and how the headers are
specific about the changes they made. You need not limit yourself to this
vocabulary. When in doubt, consult the `git log` for examples.
| **✅ Yes** | **No 🚫** |
|--------------------------------------------------|--------------------------------------------|
| Fix 'FromForm' derive docs typo: 'yis' -> 'yes'. | ~~Change word in docs~~ |
| Default 'MsgPack<T>' to named variant. | ~~Change default to more likely variant.~~ |
| Fix 'Compact' advice in 'MsgPack' docs. | ~~Update docs to make sense~~ |
| Improve 'Sentinel' docs: explain 'Sentry'. | ~~Add missing doc details.~~ |
| Fix CI: pin macOS CI 'mysql-client' to '8.4'. | ~~Fix CI~~ |
| Fix link to 'rocket::build()' in config guide. | ~~Fix wrong URL in guide (configuration~~) |
The **body** should describe what the commit does. For example, if the commit
introduces a new feature it should describe what the feature enables and how it
enables it. A body may be unnecessary if the header sufficiently describes the
commit. Avoid referencing issues in the body as well: we'll do that in the
footer. If you reference a commit, reference it by shorthash only. Feel free to
use markdown including lists and code.
Finally, the **footer** is where references to issues should be made. See the
GitHub's [linked issues] documentation.
[linked issues]: https://docs.github.com/en/issues/tracking-your-work-with-issues/linking-a-pull-request-to-an-issue
[Rust Style Guide]: https://doc.rust-lang.org/nightly/style-guide/
[issue]: https://github.com/rwf2/Rocket/issues
[pull request]: https://github.com/rwf2/Rocket/pulls
[test.sh]: scripts/test.sh
[mk-docs.sh]: scripts/mk-docs.sh
[`trybuild`]: https://docs.rs/trybuild
[sponsor the project]: https://github.com/sponsors/rwf2
[docs/guide]: docs/guide
## Licensing
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Rocket by you shall be dual licensed under the MIT License and
Apache License, Version 2.0, without any additional terms or conditions.
The Rocket website docs are licensed under [separate terms](docs/LICENSE). Any
contribution intentionally submitted for inclusion in the Rocket website docs by
you shall be licensed under those terms.
================================================
FILE: Cargo.toml
================================================
[workspace]
resolver = "2"
members = [
"core/lib/",
"core/codegen/",
"core/http/",
"contrib/db_pools/codegen/",
"contrib/db_pools/lib/",
"contrib/sync_db_pools/codegen/",
"contrib/sync_db_pools/lib/",
"contrib/dyn_templates/",
"contrib/ws/",
"docs/tests",
]
[workspace.lints.rust]
unexpected_cfgs = { level = "warn", check-cfg = ['cfg(nightly)'] }
rust_2018_idioms = "warn"
async_fn_in_trait = "allow"
refining_impl_trait = "allow"
# unreachable_pub = "warn"
# single_use_lifetimes = "warn"
# missing_docs = "warn"
[workspace.lints.clippy]
type_complexity = "allow"
module_inception = "allow"
multiple_bound_locations = "allow"
manual_range_contains = "allow"
================================================
FILE: LICENSE-APACHE
================================================
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright 2016 Sergio Benitez
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
================================================
FILE: LICENSE-MIT
================================================
The MIT License (MIT)
Copyright (c) 2016 Sergio Benitez
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
the Software without restriction, including without limitation the rights to
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so,
subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
================================================
FILE: README.md
================================================
# Rocket
[](https://github.com/rwf2/Rocket/actions)
[](https://rocket.rs)
[](https://crates.io/crates/rocket)
[](https://chat.mozilla.org/#/room/#rocket:mozilla.org)
Rocket is an async web framework for Rust with a focus on usability, security,
extensibility, and speed.
```rust
#[macro_use] extern crate rocket;
#[get("/<name>/<age>")]
fn hello(name: &str, age: u8) -> String {
format!("Hello, {} year old named {}!", age, name)
}
#[launch]
fn rocket() -> _ {
rocket::build().mount("/hello", routes![hello])
}
```
Visiting `localhost:8000/hello/John/58`, for example, will trigger the `hello`
route resulting in the string `Hello, 58 year old named John!` being sent to the
browser. If an `<age>` string was passed in that can't be parsed as a `u8`, the
route won't get called, resulting in a 404 error.
## Documentation
Rocket is extensively documented:
* [Overview]: A brief look at what makes Rocket special.
* [Quickstart]: How to get started as quickly as possible.
* [Getting Started]: How to start your first Rocket project.
* [Guide]: A detailed guide and reference to Rocket.
* [API Documentation]: The "rustdocs".
[Quickstart]: https://rocket.rs/guide/quickstart
[Getting Started]: https://rocket.rs/guide/getting-started
[Overview]: https://rocket.rs/overview/
[Guide]: https://rocket.rs/guide/
[API Documentation]: https://api.rocket.rs
Documentation for the `master` branch is available at https://rocket.rs/master
and https://api.rocket.rs/master.
Documentation for major release version `${x}` is available at
`https://[api.]rocket.rs/v${x}`. For example, the v0.4 docs are available at
https://rocket.rs/v0.4 and https://api.rocket.rs/v0.4.
Finally, API docs for active git branches are available at
`https://api.rocket.rs/${branch}`. For example, API docs for the `master` branch
are available at https://api.rocket.rs/master. Branch rustdocs are built and
deployed on every commit.
## Examples
The [examples](examples#readme) directory contains complete crates that showcase
Rocket's features and usage. Each example can be compiled and run with Cargo.
For instance, the following sequence of commands builds and runs the `hello`
example:
```sh
cd examples/hello
cargo run
```
## Getting Help
If you find yourself needing help outside of the documentation, you may:
* Ask questions via [GitHub discussions questions].
* Chat with us at [`#rocket:mozilla.org`] on Matrix (join [via Element]).
[`#rocket:mozilla.org`]: https://chat.mozilla.org/#/room/#rocket:mozilla.org
[via Element]: https://chat.mozilla.org/#/room/#rocket:mozilla.org
[GitHub discussions questions]: https://github.com/rwf2/Rocket/discussions/categories/questions
## Contributing
Contributions are absolutely, positively welcomed and encouraged! If you're
interested in contributing code, please first read [CONTRIBUTING] for complete
guidelines. Additionally, you could:
1. Submit a feature request or bug report as an [issue].
2. Ask for improved documentation as an [issue].
3. Comment on [issues that require feedback].
4. Answers questions in [GitHub discussions questions].
5. Share a project in [GitHub discussions show & tell].
[issue]: https://github.com/rwf2/Rocket/issues
[issues that require feedback]: https://github.com/rwf2/Rocket/issues?q=is%3Aissue+is%3Aopen+label%3A%22feedback+wanted%22
[pull requests]: https://github.com/rwf2/Rocket/pulls
[CONTRIBUTING]: CONTRIBUTING.md
[GitHub discussions show & tell]: https://github.com/rwf2/Rocket/discussions/categories/show-tell
## License
Rocket is licensed under either of the following, at your option:
* Apache License, Version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or https://www.apache.org/licenses/LICENSE-2.0)
* MIT License ([LICENSE-MIT](LICENSE-MIT) or https://opensource.org/licenses/MIT)
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in Rocket by you shall be dual licensed under the MIT License and
Apache License, Version 2.0, without any additional terms or conditions.
The Rocket website docs are licensed under [separate terms](docs/LICENSE). Any
contribution intentionally submitted for inclusion in the Rocket website docs by
you shall be licensed under those terms.
================================================
FILE: benchmarks/Cargo.toml
================================================
[package]
name = "rocket-benchmarks"
version = "0.0.0"
edition = "2021"
publish = false
[workspace]
[[bench]]
name = "main"
path = "src/bench.rs"
harness = false
[dev-dependencies]
rocket = { path = "../core/lib/" }
criterion = "0.5.1"
================================================
FILE: benchmarks/src/bench.rs
================================================
mod routing;
criterion::criterion_main!(routing::routing);
================================================
FILE: benchmarks/src/routing.rs
================================================
use criterion::{criterion_group, Criterion};
use rocket::{route, config, Request, Data, Route, Config};
use rocket::http::{Method, RawStr, ContentType, Accept, Status};
use rocket::local::blocking::{Client, LocalRequest};
fn dummy_handler<'r>(req: &'r Request, _: Data<'r>) -> route::BoxFuture<'r> {
route::Outcome::from(req, ()).pin()
}
fn parse_routes_table(table: &str) -> Vec<Route> {
let mut routes = vec![];
for line in table.split("\n").filter(|s| !s.is_empty()) {
let mut components = line.split(" ");
let method: Method = components.next().expect("c").parse().expect("method");
let uri: &str = components.next().unwrap();
let (mut rank, mut name, mut format) = (None, None, None);
for component in components {
match component {
c if c.starts_with('[') => rank = c.trim_matches(&['[', ']'][..]).parse().ok(),
c if c.starts_with('(') => name = Some(c.trim_matches(&['(', ')'][..])),
c => format = c.parse().ok(),
}
}
let mut route = Route::new(method, uri, dummy_handler);
if let Some(rank) = rank {
route.rank = rank;
}
route.format = format;
route.name = name.map(|s| s.to_string().into());
routes.push(route);
}
routes
}
fn generate_matching_requests<'c>(client: &'c Client, routes: &[Route]) -> Vec<LocalRequest<'c>> {
fn staticify_segment(segment: &RawStr) -> &str {
segment.as_str().trim_matches(&['<', '>', '.', '_'][..])
}
fn request_for_route<'c>(client: &'c Client, route: &Route) -> LocalRequest<'c> {
let path = route.uri.path()
.raw_segments()
.map(staticify_segment)
.collect::<Vec<_>>()
.join("/");
let query = route.uri.query()
.map(|q| q.raw_segments())
.into_iter()
.flatten()
.map(staticify_segment)
.collect::<Vec<_>>()
.join("&");
let uri = format!("/{}?{}", path, query);
let mut req = client.req(route.method.unwrap(), uri);
if let Some(ref format) = route.format {
if let Some(true) = route.method.and_then(|m| m.allows_request_body()) {
req.add_header(ContentType::from(format.clone()));
} else {
req.add_header(Accept::from(format.clone()));
}
}
req
}
routes.iter()
.map(|route| request_for_route(client, route))
.collect()
}
fn client(routes: Vec<Route>) -> Client {
let config = Config {
profile: Config::RELEASE_PROFILE,
log_level: None,
cli_colors: config::CliColors::Never,
shutdown: config::ShutdownConfig {
ctrlc: false,
#[cfg(unix)]
signals: std::collections::hash_set::HashSet::new(),
..Default::default()
},
..Default::default()
};
match Client::untracked(rocket::custom(config).mount("/", routes)) {
Ok(client) => client,
Err(e) => {
drop(e);
panic!("bad launch")
}
}
}
pub fn bench_rust_lang_routes(c: &mut Criterion) {
let table = include_str!("../static/rust-lang.routes");
let routes = parse_routes_table(table);
let client = client(routes.clone());
let requests = generate_matching_requests(&client, &routes);
c.bench_function("rust-lang.routes", |b| b.iter(|| {
for request in requests.clone() {
let response = request.dispatch();
assert_eq!(response.status(), Status::Ok);
}
}));
}
pub fn bench_bitwarden_routes(c: &mut Criterion) {
let table = include_str!("../static/bitwarden_rs.routes");
let routes = parse_routes_table(table);
let client = client(routes.clone());
let requests = generate_matching_requests(&client, &routes);
c.bench_function("bitwarden_rs.routes", |b| b.iter(|| {
for request in requests.clone() {
let response = request.dispatch();
assert_eq!(response.status(), Status::Ok);
}
}));
}
criterion_group!(routing, bench_rust_lang_routes, bench_bitwarden_routes);
================================================
FILE: benchmarks/static/bitwarden_rs.routes
================================================
GET /attachments/<uuid>/<file..> (attachments)
GET /alive (alive)
GET /bwrs_static/<filename> (static_files)
POST /api/accounts/register (register)
GET /api/accounts/profile (profile)
PUT /api/accounts/profile (put_profile)
POST /api/accounts/profile (post_profile)
GET /api/users/<uuid>/public-key (get_public_keys)
POST /api/accounts/keys (post_keys)
POST /api/accounts/password (post_password)
POST /api/accounts/kdf (post_kdf)
POST /api/accounts/key (post_rotatekey)
POST /api/accounts/security-stamp (post_sstamp)
POST /api/accounts/email-token (post_email_token)
POST /api/accounts/email (post_email)
POST /api/accounts/verify-email (post_verify_email)
POST /api/accounts/verify-email-token (post_verify_email_token)
POST /api/accounts/delete-recover (post_delete_recover)
POST /api/accounts/delete-recover-token (post_delete_recover_token)
DELETE /api/accounts (delete_account)
POST /api/accounts/delete (post_delete_account)
GET /api/accounts/revision-date (revision_date)
POST /api/accounts/password-hint (password_hint)
POST /api/accounts/prelogin (prelogin)
POST /api/accounts/verify-password (verify_password)
GET /api/sync?<data..> (sync)
GET /api/ciphers (get_ciphers)
GET /api/ciphers/<uuid> (get_cipher)
GET /api/ciphers/<uuid>/admin (get_cipher_admin)
GET /api/ciphers/<uuid>/details (get_cipher_details)
POST /api/ciphers (post_ciphers)
PUT /api/ciphers/<uuid>/admin (put_cipher_admin)
POST /api/ciphers/admin (post_ciphers_admin)
POST /api/ciphers/create (post_ciphers_create)
POST /api/ciphers/import (post_ciphers_import)
POST /api/ciphers/<uuid>/attachment multipart/form-data (post_attachment)
POST /api/ciphers/<uuid>/attachment-admin multipart/form-data (post_attachment_admin)
POST /api/ciphers/<uuid>/attachment/<attachment_id>/share multipart/form-data (post_attachment_share)
POST /api/ciphers/<uuid>/attachment/<attachment_id>/delete (delete_attachment_post)
POST /api/ciphers/<uuid>/attachment/<attachment_id>/delete-admin (delete_attachment_post_admin)
DELETE /api/ciphers/<uuid>/attachment/<attachment_id> (delete_attachment)
DELETE /api/ciphers/<uuid>/attachment/<attachment_id>/admin (delete_attachment_admin)
POST /api/ciphers/<uuid>/admin (post_cipher_admin)
POST /api/ciphers/<uuid>/share (post_cipher_share)
PUT /api/ciphers/<uuid>/share (put_cipher_share)
PUT /api/ciphers/share (put_cipher_share_selected)
POST /api/ciphers/<uuid> (post_cipher)
PUT /api/ciphers/<uuid> (put_cipher)
POST /api/ciphers/<uuid>/delete (delete_cipher_post)
POST /api/ciphers/<uuid>/delete-admin (delete_cipher_post_admin)
PUT /api/ciphers/<uuid>/delete (delete_cipher_put)
PUT /api/ciphers/<uuid>/delete-admin (delete_cipher_put_admin)
DELETE /api/ciphers/<uuid> (delete_cipher)
DELETE /api/ciphers/<uuid>/admin (delete_cipher_admin)
DELETE /api/ciphers (delete_cipher_selected)
POST /api/ciphers/delete (delete_cipher_selected_post)
PUT /api/ciphers/delete (delete_cipher_selected_put)
DELETE /api/ciphers/admin (delete_cipher_selected_admin)
POST /api/ciphers/delete-admin (delete_cipher_selected_post_admin)
PUT /api/ciphers/delete-admin (delete_cipher_selected_put_admin)
PUT /api/ciphers/<uuid>/restore (restore_cipher_put)
PUT /api/ciphers/<uuid>/restore-admin (restore_cipher_put_admin)
PUT /api/ciphers/restore (restore_cipher_selected)
POST /api/ciphers/purge?<organization..> (delete_all)
POST /api/ciphers/move (move_cipher_selected)
PUT /api/ciphers/move (move_cipher_selected_put)
PUT /api/ciphers/<uuid>/collections (put_collections_update)
POST /api/ciphers/<uuid>/collections (post_collections_update)
POST /api/ciphers/<uuid>/collections-admin (post_collections_admin)
PUT /api/ciphers/<uuid>/collections-admin (put_collections_admin)
GET /api/folders (get_folders)
GET /api/folders/<uuid> (get_folder)
POST /api/folders (post_folders)
POST /api/folders/<uuid> (post_folder)
PUT /api/folders/<uuid> (put_folder)
POST /api/folders/<uuid>/delete (delete_folder_post)
DELETE /api/folders/<uuid> (delete_folder)
GET /api/organizations/<org_id> (get_organization)
POST /api/organizations (create_organization)
DELETE /api/organizations/<org_id> (delete_organization)
POST /api/organizations/<org_id>/delete (post_delete_organization)
POST /api/organizations/<org_id>/leave (leave_organization)
GET /api/collections (get_user_collections)
GET /api/organizations/<org_id>/collections (get_org_collections)
GET /api/organizations/<org_id>/collections/<coll_id>/details (get_org_collection_detail)
GET /api/organizations/<org_id>/collections/<coll_id>/users (get_collection_users)
PUT /api/organizations/<org_id>/collections/<coll_id>/users (put_collection_users)
PUT /api/organizations/<org_id> (put_organization)
POST /api/organizations/<org_id> (post_organization)
POST /api/organizations/<org_id>/collections (post_organization_collections)
DELETE /api/organizations/<org_id>/collections/<col_id>/user/<org_user_id> (delete_organization_collection_user)
POST /api/organizations/<org_id>/collections/<col_id>/delete-user/<org_user_id> (post_organization_collection_delete_user)
POST /api/organizations/<org_id>/collections/<col_id> (post_organization_collection_update)
PUT /api/organizations/<org_id>/collections/<col_id> (put_organization_collection_update)
DELETE /api/organizations/<org_id>/collections/<col_id> (delete_organization_collection)
POST /api/organizations/<org_id>/collections/<col_id>/delete (post_organization_collection_delete)
GET /api/ciphers/organization-details?<data..> (get_org_details)
GET /api/organizations/<org_id>/users (get_org_users)
POST /api/organizations/<org_id>/users/invite (send_invite)
POST /api/organizations/<org_id>/users/<user_org>/reinvite (reinvite_user)
POST /api/organizations/<org_id>/users/<org_user_id>/confirm (confirm_invite)
POST /api/organizations/<_org_id>/users/<_org_user_id>/accept (accept_invite)
GET /api/organizations/<org_id>/users/<org_user_id> (get_user)
POST /api/organizations/<org_id>/users/<org_user_id> [1] (edit_user)
PUT /api/organizations/<org_id>/users/<org_user_id> (put_organization_user)
DELETE /api/organizations/<org_id>/users/<org_user_id> (delete_user)
POST /api/organizations/<org_id>/users/<org_user_id>/delete (post_delete_user)
POST /api/ciphers/import-organization?<query..> (post_org_import)
GET /api/organizations/<org_id>/policies (list_policies)
GET /api/organizations/<org_id>/policies/token?<token> (list_policies_token)
GET /api/organizations/<org_id>/policies/<pol_type> (get_policy)
PUT /api/organizations/<org_id>/policies/<pol_type> (put_policy)
GET /api/organizations/<org_id>/tax (get_organization_tax)
GET /api/plans (get_plans)
GET /api/plans/sales-tax-rates (get_plans_tax_rates)
POST /api/organizations/<org_id>/import (import)
GET /api/two-factor (get_twofactor)
POST /api/two-factor/get-recover (get_recover)
POST /api/two-factor/recover (recover)
POST /api/two-factor/disable (disable_twofactor)
PUT /api/two-factor/disable (disable_twofactor_put)
POST /api/two-factor/get-authenticator (generate_authenticator)
POST /api/two-factor/authenticator (activate_authenticator)
PUT /api/two-factor/authenticator (activate_authenticator_put)
POST /api/two-factor/get-duo (get_duo)
POST /api/two-factor/duo (activate_duo)
PUT /api/two-factor/duo (activate_duo_put)
POST /api/two-factor/get-email (get_email)
POST /api/two-factor/send-email-login (send_email_login)
POST /api/two-factor/send-email (send_email)
PUT /api/two-factor/email (email)
POST /api/two-factor/get-u2f (generate_u2f)
POST /api/two-factor/get-u2f-challenge (generate_u2f_challenge)
POST /api/two-factor/u2f (activate_u2f)
PUT /api/two-factor/u2f (activate_u2f_put)
DELETE /api/two-factor/u2f (delete_u2f)
POST /api/two-factor/get-yubikey (generate_yubikey)
POST /api/two-factor/yubikey (activate_yubikey)
PUT /api/two-factor/yubikey (activate_yubikey_put)
POST /api/sends (post_send)
POST /api/sends/file multipart/form-data (post_send_file)
POST /api/sends/access/<access_id> (post_access)
POST /api/sends/<send_id>/access/file/<file_id> (post_access_file)
PUT /api/sends/<id> (put_send)
DELETE /api/sends/<id> (delete_send)
PUT /api/sends/<id>/remove-password (put_remove_password)
PUT /api/devices/identifier/<uuid>/clear-token (clear_device_token)
PUT /api/devices/identifier/<uuid>/token (put_device_token)
GET /api/settings/domains (get_eq_domains)
POST /api/settings/domains (post_eq_domains)
PUT /api/settings/domains (put_eq_domains)
GET /api/hibp/breach?<username> (hibp_breach)
GET /admin (admin_disabled)
POST /identity/connect/token (login)
GET /icons/<domain>/icon.png (icon)
POST /notifications/hub/negotiate (negotiate)
GET /notifications/hub (websockets_err)
================================================
FILE: benchmarks/static/rust-lang.routes
================================================
GET / (index)
GET /<category> (category)
GET /governance (governance)
GET /governance/<section>/<team> [2] (team)
GET /production/users (production)
GET /sponsors (sponsors)
GET /<category>/<subject> [4] (subject)
GET /static/<file..> (files)
GET /robots.txt (robots_txt)
GET /logos/<file..> (logos)
GET /components/<_file..> (components)
GET /<locale> [3] (index_locale)
GET /<locale>/<category> [11] (category_locale)
GET /<locale>/governance [10] (governance_locale)
GET /<locale>/governance/<section>/<team> [12] (team_locale)
GET /<locale>/production/users [10] (production_locale)
GET /<locale>/sponsors [10] (sponsors_locale)
GET /<locale>/<category>/<subject> [14] (subject_locale)
GET /<locale>/components/<_file..> [12] (components_locale)
GET /<dest> [19] (redirect)
GET /pdfs/<dest> (redirect_pdfs)
GET /en-US (redirect_bare_en_us)
GET /<_locale> [20] (redirect_bare_locale)
GET /en-US/<dest> (redirect_en_us)
GET /<_locale>/<dest> [20] (redirect_locale)
================================================
FILE: contrib/db_pools/README.md
================================================
# `db_pools` [![ci.svg]][ci] [![crates.io]][crate] [![docs.svg]][crate docs]
[crates.io]: https://img.shields.io/crates/v/rocket_db_pools.svg
[crate]: https://crates.io/crates/rocket_db_pools
[docs.svg]: https://img.shields.io/badge/web-master-red.svg?style=flat&label=docs&colorB=d33847
[crate docs]: https://api.rocket.rs/master/rocket_db_pools
[ci.svg]: https://github.com/rwf2/Rocket/workflows/CI/badge.svg
[ci]: https://github.com/rwf2/Rocket/actions
Asynchronous database driver integration for Rocket. See the [crate docs] for
full usage details.
## Usage
1. Add `rocket_db_pools` as a dependency with one or more [database driver
features] enabled:
```toml
[dependencies.rocket_db_pools]
version = "0.1.0"
features = ["sqlx_sqlite"]
```
2. Choose a name for your database, here `sqlite_logs`. [Configure] _at least_ a
URL for the database:
```toml
[default.databases.sqlite_logs]
url = "/path/to/database.sqlite"
```
3. [Derive `Database`] for a unit type (`Logs` here) which
wraps the selected driver's [`Pool`] type and is decorated with
`#[database("name")]`. Attach `Type::init()` to your application's `Rocket`
to initialize the database pool:
```rust
use rocket_db_pools::{Database, Connection};
#[derive(Database)]
#[database("sqlite_logs")]
struct Logs(sqlx::SqlitePool);
#[launch]
fn rocket() -> _ {
rocket::build().attach(Logs::init())
}
```
4. Use [`Connection<Type>`] as a request guard to retrieve an
active database connection:
```rust
#[get("/<id>")]
async fn read(mut db: Connection<Logs>, id: i64) -> Result<Log> {
sqlx::query!("SELECT content FROM logs WHERE id = ?", id)
.fetch_one(&mut *db)
.map_ok(|r| Log(r.content))
.await
}
```
[database driver features]: https://api.rocket.rs/master/rocket_db_pools/index.html#supported-drivers
[`Pool`]: https://api.rocket.rs/master/rocket_db_pools/index.html#supported-drivers
[Configure]: https://api.rocket.rs/master/rocket_db_pools/index.html#configuration
[Derive `Database`]: https://api.rocket.rs/master/rocket_db_pools/derive.Database.html
[`Connection<Type>`]: https://api.rocket.rs/master/rocket_db_pools/struct.Connection.html
================================================
FILE: contrib/db_pools/codegen/Cargo.toml
================================================
[package]
name = "rocket_db_pools_codegen"
version = "0.1.0"
authors = ["Sergio Benitez <sb@sergio.bz>", "Jeb Rosen <jeb@jebrosen.com>"]
description = "Procedural macros for rocket_db_pools."
repository = "https://github.com/rwf2/Rocket/tree/master/contrib/db_pools"
readme = "../README.md"
keywords = ["rocket", "framework", "database", "pools"]
license = "MIT OR Apache-2.0"
edition = "2021"
rust-version = "1.75"
[lib]
proc-macro = true
[lints]
workspace = true
[dependencies]
devise = "0.4"
quote = "1"
[dev-dependencies]
rocket = { path = "../../../core/lib", default-features = false }
rocket_db_pools = { path = "../lib", features = ["deadpool_postgres"] }
trybuild = "1.0"
version_check = "0.9"
================================================
FILE: contrib/db_pools/codegen/src/database.rs
================================================
use proc_macro::TokenStream;
use devise::{DeriveGenerator, FromMeta, MapperBuild, Support, ValidatorBuild};
use devise::proc_macro2_diagnostics::SpanDiagnosticExt;
use devise::syn::{self, spanned::Spanned};
const ONE_DATABASE_ATTR: &str = "missing `#[database(\"name\")]` attribute";
const ONE_UNNAMED_FIELD: &str = "struct must have exactly one unnamed field";
#[derive(Debug, FromMeta)]
struct DatabaseAttribute {
#[meta(naked)]
name: String,
}
pub fn derive_database(input: TokenStream) -> TokenStream {
DeriveGenerator::build_for(input, quote!(impl rocket_db_pools::Database))
.support(Support::TupleStruct)
.validator(ValidatorBuild::new()
.struct_validate(|_, s| {
if s.fields.len() == 1 {
Ok(())
} else {
Err(s.span().error(ONE_UNNAMED_FIELD))
}
})
)
.outer_mapper(MapperBuild::new()
.struct_map(|_, s| {
let pool_type = match &s.fields {
syn::Fields::Unnamed(f) => &f.unnamed[0].ty,
_ => unreachable!("Support::TupleStruct"),
};
let decorated_type = &s.ident;
let db_ty = quote_spanned!(decorated_type.span() =>
<#decorated_type as rocket_db_pools::Database>
);
quote_spanned! { decorated_type.span() =>
impl From<#pool_type> for #decorated_type {
fn from(pool: #pool_type) -> Self {
Self(pool)
}
}
impl std::ops::Deref for #decorated_type {
type Target = #pool_type;
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl std::ops::DerefMut for #decorated_type {
fn deref_mut(&mut self) -> &mut Self::Target {
&mut self.0
}
}
#[rocket::async_trait]
impl<'r> rocket::request::FromRequest<'r> for &'r #decorated_type {
type Error = ();
async fn from_request(
req: &'r rocket::request::Request<'_>
) -> rocket::request::Outcome<Self, Self::Error> {
match #db_ty::fetch(req.rocket()) {
Some(db) => rocket::outcome::Outcome::Success(db),
None => rocket::outcome::Outcome::Error((
rocket::http::Status::InternalServerError, ()))
}
}
}
impl rocket::Sentinel for &#decorated_type {
fn abort(rocket: &rocket::Rocket<rocket::Ignite>) -> bool {
#db_ty::fetch(rocket).is_none()
}
}
}
})
)
.outer_mapper(quote!(#[rocket::async_trait]))
.inner_mapper(MapperBuild::new()
.try_struct_map(|_, s| {
let db_name = DatabaseAttribute::one_from_attrs("database", &s.attrs)?
.map(|attr| attr.name)
.ok_or_else(|| s.span().error(ONE_DATABASE_ATTR))?;
let fairing_name = format!("'{}' Database Pool", db_name);
let pool_type = match &s.fields {
syn::Fields::Unnamed(f) => &f.unnamed[0].ty,
_ => unreachable!("Support::TupleStruct"),
};
Ok(quote_spanned! { pool_type.span() =>
type Pool = #pool_type;
const NAME: &'static str = #db_name;
fn init() -> rocket_db_pools::Initializer<Self> {
rocket_db_pools::Initializer::with_name(#fairing_name)
}
})
})
)
.to_tokens()
}
================================================
FILE: contrib/db_pools/codegen/src/lib.rs
================================================
#![recursion_limit="256"]
#![warn(rust_2018_idioms)]
//! # `rocket_db_pool` - Code Generation
//!
//! Implements the code generation portion of the `rocket_db_pool` crate. This
//! is an implementation detail. This create should never be depended on
//! directly.
#[macro_use] extern crate quote;
mod database;
/// Automatic derive for the [`Database`] trait.
///
/// ```rust
/// use rocket_db_pools::Database;
/// # type PoolType = rocket_db_pools::deadpool_postgres::Pool;
///
/// #[derive(Database)]
/// #[database("database_name")]
/// struct Db(PoolType);
/// ```
///
/// The derive generates an implementation of [`Database`] as follows:
///
/// * [`Database::NAME`] is set to the value in the `#[database("name")]`
/// attribute.
///
/// This names the database, providing an anchor to configure the database via
/// `Rocket.toml` or any other configuration source. Specifically, the
/// configuration in `databases.name` is used to configure the driver.
///
/// * [`Database::Pool`] is set to the wrapped type: `PoolType` above. The type
/// must implement [`Pool`].
///
/// To meet the required [`Database`] supertrait bounds, this derive also
/// generates implementations for:
///
/// * `From<Db::Pool>`
///
/// * `Deref<Target = Db::Pool>`
///
/// * `DerefMut<Target = Db::Pool>`
///
/// * `FromRequest<'_> for &Db`
///
/// * `Sentinel for &Db`
///
/// The `Deref` impls enable accessing the database pool directly from
/// references `&Db` or `&mut Db`. To force a dereference to the underlying
/// type, use `&db.0` or `&**db` or their `&mut` variants.
///
/// [`Database`]: ../rocket_db_pools/trait.Database.html
/// [`Database::NAME`]: ../rocket_db_pools/trait.Database.html#associatedconstant.NAME
/// [`Database::Pool`]: ../rocket_db_pools/trait.Database.html#associatedtype.Pool
/// [`Pool`]: ../rocket_db_pools/trait.Pool.html
#[proc_macro_derive(Database, attributes(database))]
pub fn derive_database(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
crate::database::derive_database(input)
}
================================================
FILE: contrib/db_pools/codegen/tests/ui-fail/database-syntax.rs
================================================
use rocket_db_pools::{deadpool_postgres, Database};
#[derive(Database)]
#[database(123)]
struct A(deadpool_postgres::Pool);
#[derive(Database)]
#[database("some-name", "another")]
struct B(deadpool_postgres::Pool);
#[derive(Database)]
#[database("some-name", name = "another")]
struct C(deadpool_postgres::Pool);
#[derive(Database)]
#[database("foo")]
enum D { }
#[derive(Database)]
struct E(deadpool_postgres::Pool);
#[derive(Database)]
#[database("foo")]
struct F;
#[derive(Database)]
#[database("foo")]
struct G(deadpool_postgres::Pool, deadpool_postgres::Pool);
#[derive(Database)]
#[database("foo")]
struct H {
foo: deadpool_postgres::Pool,
}
fn main() { }
================================================
FILE: contrib/db_pools/codegen/tests/ui-fail/database-types.rs
================================================
#[macro_use] extern crate rocket_db_pools;
struct Unknown;
#[derive(Database)]
#[database("foo")]
struct A(Unknown);
#[derive(Database)]
#[database("bar")]
struct B(Vec<i32>);
fn main() { }
================================================
FILE: contrib/db_pools/codegen/tests/ui-fail-nightly/database-syntax.stderr
================================================
error: invalid value: expected string literal
--> tests/ui-fail-nightly/database-syntax.rs:4:12
|
4 | #[database(123)]
| ^^^
|
note: error occurred while deriving `Database`
--> tests/ui-fail-nightly/database-syntax.rs:3:10
|
3 | #[derive(Database)]
| ^^^^^^^^
= note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info)
error: expected key/value `key = value`
--> tests/ui-fail-nightly/database-syntax.rs:8:25
|
8 | #[database("some-name", "another")]
| ^^^^^^^^^
|
note: error occurred while deriving `Database`
--> tests/ui-fail-nightly/database-syntax.rs:7:10
|
7 | #[derive(Database)]
| ^^^^^^^^
= note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info)
error: unexpected attribute parameter: `name`
--> tests/ui-fail-nightly/database-syntax.rs:12:25
|
12 | #[database("some-name", name = "another")]
| ^^^^^^^^^^^^^^^^
|
note: error occurred while deriving `Database`
--> tests/ui-fail-nightly/database-syntax.rs:11:10
|
11 | #[derive(Database)]
| ^^^^^^^^
= note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info)
error: enums are not supported
--> tests/ui-fail-nightly/database-syntax.rs:16:1
|
16 | / #[database("foo")]
17 | | enum D { }
| |___________^
|
note: error occurred while deriving `Database`
--> tests/ui-fail-nightly/database-syntax.rs:15:10
|
15 | #[derive(Database)]
| ^^^^^^^^
= note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info)
error: missing `#[database("name")]` attribute
--> tests/ui-fail-nightly/database-syntax.rs:20:1
|
20 | struct E(deadpool_postgres::Pool);
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
note: error occurred while deriving `Database`
--> tests/ui-fail-nightly/database-syntax.rs:19:10
|
19 | #[derive(Database)]
| ^^^^^^^^
= note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info)
error: struct must have exactly one unnamed field
--> tests/ui-fail-nightly/database-syntax.rs:23:1
|
23 | / #[database("foo")]
24 | | struct F;
| |_________^
|
note: error occurred while deriving `Database`
--> tests/ui-fail-nightly/database-syntax.rs:22:10
|
22 | #[derive(Database)]
| ^^^^^^^^
= note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info)
error: struct must have exactly one unnamed field
--> tests/ui-fail-nightly/database-syntax.rs:27:1
|
27 | / #[database("foo")]
28 | | struct G(deadpool_postgres::Pool, deadpool_postgres::Pool);
| |___________________________________________________________^
|
note: error occurred while deriving `Database`
--> tests/ui-fail-nightly/database-syntax.rs:26:10
|
26 | #[derive(Database)]
| ^^^^^^^^
= note: this error originates in the derive macro `Database` (in Nightly builds, run with -Z macro-backtrace for more info)
error: named structs are not supported
--> tests/ui-fail-nightly/database-syntax.rs:31:1
|
31 | / #[database("foo")]
32 | | struct H {
33 | | foo: deadpool_postgres::Pool,
34 | | }
gitextract_jjluluj_/
├── .editorconfig
├── .gitattributes
├── .github/
│ ├── CODE_OF_CONDUCT.md
│ ├── FUNDING.yml
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug-report.yml
│ │ ├── config.yml
│ │ ├── doc-problem.yml
│ │ ├── feature-request.yml
│ │ └── suggestion.yml
│ └── workflows/
│ ├── ci.yml
│ └── trigger.yaml
├── .gitignore
├── .rustfmt.toml
├── CHANGELOG.md
├── CONTRIBUTING.md
├── Cargo.toml
├── LICENSE-APACHE
├── LICENSE-MIT
├── README.md
├── benchmarks/
│ ├── Cargo.toml
│ ├── src/
│ │ ├── bench.rs
│ │ └── routing.rs
│ └── static/
│ ├── bitwarden_rs.routes
│ └── rust-lang.routes
├── contrib/
│ ├── db_pools/
│ │ ├── README.md
│ │ ├── codegen/
│ │ │ ├── Cargo.toml
│ │ │ ├── src/
│ │ │ │ ├── database.rs
│ │ │ │ └── lib.rs
│ │ │ └── tests/
│ │ │ ├── ui-fail/
│ │ │ │ ├── database-syntax.rs
│ │ │ │ └── database-types.rs
│ │ │ ├── ui-fail-nightly/
│ │ │ │ ├── database-syntax.stderr
│ │ │ │ └── database-types.stderr
│ │ │ ├── ui-fail-stable/
│ │ │ │ ├── database-syntax.stderr
│ │ │ │ └── database-types.stderr
│ │ │ └── ui-fail.rs
│ │ └── lib/
│ │ ├── Cargo.toml
│ │ ├── src/
│ │ │ ├── config.rs
│ │ │ ├── database.rs
│ │ │ ├── diesel.rs
│ │ │ ├── error.rs
│ │ │ ├── lib.rs
│ │ │ └── pool.rs
│ │ └── tests/
│ │ └── databases.rs
│ ├── dyn_templates/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── src/
│ │ │ ├── context.rs
│ │ │ ├── engine/
│ │ │ │ ├── handlebars.rs
│ │ │ │ ├── minijinja.rs
│ │ │ │ ├── mod.rs
│ │ │ │ └── tera.rs
│ │ │ ├── fairing.rs
│ │ │ ├── lib.rs
│ │ │ ├── metadata.rs
│ │ │ └── template.rs
│ │ └── tests/
│ │ ├── templates/
│ │ │ ├── hbs/
│ │ │ │ ├── common/
│ │ │ │ │ ├── footer.html.hbs
│ │ │ │ │ └── header.html.hbs
│ │ │ │ ├── reload.txt.hbs
│ │ │ │ └── test.html.hbs
│ │ │ ├── j2/
│ │ │ │ ├── [test]/
│ │ │ │ │ └── html_test.html.j2
│ │ │ │ ├── base.txt.j2
│ │ │ │ ├── html_test.html.j2
│ │ │ │ └── txt_test.txt.j2
│ │ │ └── tera/
│ │ │ ├── [test]/
│ │ │ │ └── html_test.html.tera
│ │ │ ├── base.txt.tera
│ │ │ ├── html_test.html.tera
│ │ │ └── txt_test.txt.tera
│ │ └── templates.rs
│ ├── sync_db_pools/
│ │ ├── README.md
│ │ ├── codegen/
│ │ │ ├── Cargo.toml
│ │ │ ├── src/
│ │ │ │ ├── database.rs
│ │ │ │ └── lib.rs
│ │ │ └── tests/
│ │ │ ├── ui-fail/
│ │ │ │ ├── database-syntax.rs
│ │ │ │ └── database-types.rs
│ │ │ ├── ui-fail-nightly/
│ │ │ │ ├── database-syntax.stderr
│ │ │ │ └── database-types.stderr
│ │ │ ├── ui-fail-stable/
│ │ │ │ ├── database-syntax.stderr
│ │ │ │ └── database-types.stderr
│ │ │ └── ui-fail.rs
│ │ └── lib/
│ │ ├── Cargo.toml
│ │ ├── build.rs
│ │ ├── src/
│ │ │ ├── config.rs
│ │ │ ├── connection.rs
│ │ │ ├── error.rs
│ │ │ ├── lib.rs
│ │ │ └── poolable.rs
│ │ └── tests/
│ │ ├── databases.rs
│ │ ├── drop-with-connection.rs
│ │ └── shutdown.rs
│ └── ws/
│ ├── Cargo.toml
│ ├── README.md
│ └── src/
│ ├── duplex.rs
│ ├── lib.rs
│ └── websocket.rs
├── core/
│ ├── codegen/
│ │ ├── Cargo.toml
│ │ ├── src/
│ │ │ ├── attribute/
│ │ │ │ ├── async_bound/
│ │ │ │ │ └── mod.rs
│ │ │ │ ├── catch/
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ └── parse.rs
│ │ │ │ ├── entry/
│ │ │ │ │ ├── launch.rs
│ │ │ │ │ ├── main.rs
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ └── test.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── param/
│ │ │ │ │ ├── guard.rs
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ └── parse.rs
│ │ │ │ ├── route/
│ │ │ │ │ ├── mod.rs
│ │ │ │ │ └── parse.rs
│ │ │ │ └── suppress/
│ │ │ │ ├── lint.rs
│ │ │ │ └── mod.rs
│ │ │ ├── bang/
│ │ │ │ ├── export.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── test_guide.rs
│ │ │ │ ├── typed_stream.rs
│ │ │ │ ├── uri.rs
│ │ │ │ └── uri_parsing.rs
│ │ │ ├── derive/
│ │ │ │ ├── form_field.rs
│ │ │ │ ├── from_form.rs
│ │ │ │ ├── from_form_field.rs
│ │ │ │ ├── from_param.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── responder.rs
│ │ │ │ └── uri_display.rs
│ │ │ ├── exports.rs
│ │ │ ├── http_codegen.rs
│ │ │ ├── lib.rs
│ │ │ ├── name.rs
│ │ │ ├── proc_macro_ext.rs
│ │ │ └── syn_ext.rs
│ │ └── tests/
│ │ ├── async-entry.rs
│ │ ├── async-routes.rs
│ │ ├── catcher.rs
│ │ ├── expansion.rs
│ │ ├── from_form.rs
│ │ ├── from_form_field.rs
│ │ ├── from_param.rs
│ │ ├── responder.rs
│ │ ├── route-data.rs
│ │ ├── route-format.rs
│ │ ├── route-ranking.rs
│ │ ├── route-raw.rs
│ │ ├── route-uniqueness.rs
│ │ ├── route.rs
│ │ ├── segment-ignore.rs
│ │ ├── typed-uris.rs
│ │ ├── ui-fail/
│ │ │ ├── async-entry.rs
│ │ │ ├── bad-ignored-segments.rs
│ │ │ ├── catch.rs
│ │ │ ├── catch_type_errors.rs
│ │ │ ├── catchers.rs
│ │ │ ├── from_form.rs
│ │ │ ├── from_form_field.rs
│ │ │ ├── from_form_type_errors.rs
│ │ │ ├── from_param.rs
│ │ │ ├── responder-types.rs
│ │ │ ├── responder.rs
│ │ │ ├── route-attribute-general-syntax.rs
│ │ │ ├── route-path-bad-syntax.rs
│ │ │ ├── route-type-errors.rs
│ │ │ ├── route-warnings.rs
│ │ │ ├── routes.rs
│ │ │ ├── synchronize.sh
│ │ │ ├── typed-uri-bad-type.rs
│ │ │ ├── typed-uris-bad-params.rs
│ │ │ ├── typed-uris-invalid-syntax.rs
│ │ │ ├── uri_display.rs
│ │ │ └── uri_display_type_errors.rs
│ │ ├── ui-fail-nightly/
│ │ │ ├── async-entry.stderr
│ │ │ ├── bad-ignored-segments.stderr
│ │ │ ├── catch.stderr
│ │ │ ├── catch_type_errors.stderr
│ │ │ ├── catchers.stderr
│ │ │ ├── from_form.stderr
│ │ │ ├── from_form_field.stderr
│ │ │ ├── from_form_type_errors.stderr
│ │ │ ├── from_param.stderr
│ │ │ ├── responder-types.stderr
│ │ │ ├── responder.stderr
│ │ │ ├── route-attribute-general-syntax.stderr
│ │ │ ├── route-path-bad-syntax.stderr
│ │ │ ├── route-type-errors.stderr
│ │ │ ├── route-warnings.stderr
│ │ │ ├── routes.stderr
│ │ │ ├── typed-uri-bad-type.stderr
│ │ │ ├── typed-uris-bad-params.stderr
│ │ │ ├── typed-uris-invalid-syntax.stderr
│ │ │ ├── uri_display.stderr
│ │ │ └── uri_display_type_errors.stderr
│ │ ├── ui-fail-stable/
│ │ │ ├── async-entry.stderr
│ │ │ ├── bad-ignored-segments.stderr
│ │ │ ├── catch.stderr
│ │ │ ├── catch_type_errors.stderr
│ │ │ ├── catchers.stderr
│ │ │ ├── from_form.stderr
│ │ │ ├── from_form_field.stderr
│ │ │ ├── from_form_type_errors.stderr
│ │ │ ├── from_param.stderr
│ │ │ ├── responder-types.stderr
│ │ │ ├── responder.stderr
│ │ │ ├── route-attribute-general-syntax.stderr
│ │ │ ├── route-path-bad-syntax.stderr
│ │ │ ├── route-type-errors.stderr
│ │ │ ├── route-warnings.stderr
│ │ │ ├── routes.stderr
│ │ │ ├── typed-uri-bad-type.stderr
│ │ │ ├── typed-uris-bad-params.stderr
│ │ │ ├── typed-uris-invalid-syntax.stderr
│ │ │ ├── uri_display.stderr
│ │ │ └── uri_display_type_errors.stderr
│ │ ├── ui-fail.rs
│ │ └── uri_display.rs
│ ├── http/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── ext.rs
│ │ ├── header/
│ │ │ ├── accept.rs
│ │ │ ├── content_type.rs
│ │ │ ├── header.rs
│ │ │ ├── known_media_types.rs
│ │ │ ├── media_type.rs
│ │ │ ├── mod.rs
│ │ │ └── proxy_proto.rs
│ │ ├── lib.rs
│ │ ├── method.rs
│ │ ├── parse/
│ │ │ ├── accept.rs
│ │ │ ├── checkers.rs
│ │ │ ├── indexed.rs
│ │ │ ├── media_type.rs
│ │ │ ├── mod.rs
│ │ │ └── uri/
│ │ │ ├── error.rs
│ │ │ ├── mod.rs
│ │ │ ├── parser.rs
│ │ │ ├── spec.txt
│ │ │ ├── tables.rs
│ │ │ └── tests.rs
│ │ ├── raw_str.rs
│ │ ├── status.rs
│ │ └── uri/
│ │ ├── absolute.rs
│ │ ├── asterisk.rs
│ │ ├── authority.rs
│ │ ├── error.rs
│ │ ├── fmt/
│ │ │ ├── encoding.rs
│ │ │ ├── formatter.rs
│ │ │ ├── from_uri_param.rs
│ │ │ ├── mod.rs
│ │ │ ├── part.rs
│ │ │ └── uri_display.rs
│ │ ├── host.rs
│ │ ├── mod.rs
│ │ ├── origin.rs
│ │ ├── path_query.rs
│ │ ├── reference.rs
│ │ ├── segments.rs
│ │ └── uri.rs
│ └── lib/
│ ├── Cargo.toml
│ ├── build.rs
│ ├── fuzz/
│ │ ├── .gitignore
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── corpus/
│ │ │ ├── collision-matching/
│ │ │ │ ├── another.seed
│ │ │ │ ├── base.seed
│ │ │ │ ├── complex.seed
│ │ │ │ └── large.seed
│ │ │ └── uri-parsing/
│ │ │ ├── absolute.seed
│ │ │ ├── asterisk.seed
│ │ │ ├── authority.seed
│ │ │ ├── origin.seed
│ │ │ └── reference.seed
│ │ └── targets/
│ │ ├── collision-matching.rs
│ │ ├── uri-normalization.rs
│ │ ├── uri-parsing.rs
│ │ └── uri-roundtrip.rs
│ ├── src/
│ │ ├── catcher/
│ │ │ ├── catcher.rs
│ │ │ ├── handler.rs
│ │ │ └── mod.rs
│ │ ├── config/
│ │ │ ├── cli_colors.rs
│ │ │ ├── config.rs
│ │ │ ├── http_header.rs
│ │ │ ├── ident.rs
│ │ │ ├── mod.rs
│ │ │ ├── secret_key.rs
│ │ │ └── tests.rs
│ │ ├── data/
│ │ │ ├── capped.rs
│ │ │ ├── data.rs
│ │ │ ├── data_stream.rs
│ │ │ ├── from_data.rs
│ │ │ ├── io_stream.rs
│ │ │ ├── limits.rs
│ │ │ ├── mod.rs
│ │ │ ├── peekable.rs
│ │ │ └── transform.rs
│ │ ├── erased.rs
│ │ ├── error.rs
│ │ ├── fairing/
│ │ │ ├── ad_hoc.rs
│ │ │ ├── fairings.rs
│ │ │ ├── info_kind.rs
│ │ │ └── mod.rs
│ │ ├── form/
│ │ │ ├── buffer.rs
│ │ │ ├── context.rs
│ │ │ ├── error.rs
│ │ │ ├── field.rs
│ │ │ ├── form.rs
│ │ │ ├── from_form.rs
│ │ │ ├── from_form_field.rs
│ │ │ ├── lenient.rs
│ │ │ ├── mod.rs
│ │ │ ├── name/
│ │ │ │ ├── buf.rs
│ │ │ │ ├── key.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── name.rs
│ │ │ │ └── view.rs
│ │ │ ├── options.rs
│ │ │ ├── parser.rs
│ │ │ ├── strict.rs
│ │ │ ├── tests.rs
│ │ │ └── validate.rs
│ │ ├── fs/
│ │ │ ├── file_name.rs
│ │ │ ├── mod.rs
│ │ │ ├── named_file.rs
│ │ │ ├── rewrite.rs
│ │ │ ├── server.rs
│ │ │ └── temp_file.rs
│ │ ├── http/
│ │ │ ├── cookies.rs
│ │ │ └── mod.rs
│ │ ├── lib.rs
│ │ ├── lifecycle.rs
│ │ ├── listener/
│ │ │ ├── bind.rs
│ │ │ ├── bounced.rs
│ │ │ ├── cancellable.rs
│ │ │ ├── connection.rs
│ │ │ ├── default.rs
│ │ │ ├── endpoint.rs
│ │ │ ├── listener.rs
│ │ │ ├── mod.rs
│ │ │ ├── quic.rs
│ │ │ ├── tcp.rs
│ │ │ └── unix.rs
│ │ ├── local/
│ │ │ ├── asynchronous/
│ │ │ │ ├── client.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── request.rs
│ │ │ │ └── response.rs
│ │ │ ├── blocking/
│ │ │ │ ├── client.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── request.rs
│ │ │ │ └── response.rs
│ │ │ ├── client.rs
│ │ │ ├── mod.rs
│ │ │ ├── request.rs
│ │ │ └── response.rs
│ │ ├── mtls/
│ │ │ ├── certificate.rs
│ │ │ ├── config.rs
│ │ │ ├── error.rs
│ │ │ ├── mod.rs
│ │ │ └── name.rs
│ │ ├── outcome.rs
│ │ ├── phase.rs
│ │ ├── request/
│ │ │ ├── atomic_method.rs
│ │ │ ├── from_param.rs
│ │ │ ├── from_request.rs
│ │ │ ├── mod.rs
│ │ │ ├── request.rs
│ │ │ └── tests.rs
│ │ ├── response/
│ │ │ ├── body.rs
│ │ │ ├── content.rs
│ │ │ ├── debug.rs
│ │ │ ├── flash.rs
│ │ │ ├── mod.rs
│ │ │ ├── redirect.rs
│ │ │ ├── responder.rs
│ │ │ ├── response.rs
│ │ │ ├── status.rs
│ │ │ └── stream/
│ │ │ ├── bytes.rs
│ │ │ ├── mod.rs
│ │ │ ├── one.rs
│ │ │ ├── raw_sse.rs
│ │ │ ├── reader.rs
│ │ │ ├── sse.rs
│ │ │ └── text.rs
│ │ ├── rocket.rs
│ │ ├── route/
│ │ │ ├── handler.rs
│ │ │ ├── mod.rs
│ │ │ ├── route.rs
│ │ │ ├── segment.rs
│ │ │ └── uri.rs
│ │ ├── router/
│ │ │ ├── collider.rs
│ │ │ ├── matcher.rs
│ │ │ ├── mod.rs
│ │ │ └── router.rs
│ │ ├── sentinel.rs
│ │ ├── serde/
│ │ │ ├── json.rs
│ │ │ ├── mod.rs
│ │ │ ├── msgpack.rs
│ │ │ └── uuid.rs
│ │ ├── server.rs
│ │ ├── shield/
│ │ │ ├── mod.rs
│ │ │ ├── policy.rs
│ │ │ └── shield.rs
│ │ ├── shutdown/
│ │ │ ├── config.rs
│ │ │ ├── handle.rs
│ │ │ ├── mod.rs
│ │ │ ├── sig.rs
│ │ │ └── tripwire.rs
│ │ ├── state.rs
│ │ ├── tls/
│ │ │ ├── config.rs
│ │ │ ├── error.rs
│ │ │ ├── listener.rs
│ │ │ ├── mod.rs
│ │ │ └── resolver.rs
│ │ ├── trace/
│ │ │ ├── level.rs
│ │ │ ├── macros.rs
│ │ │ ├── mod.rs
│ │ │ ├── subscriber/
│ │ │ │ ├── common.rs
│ │ │ │ ├── compact.rs
│ │ │ │ ├── dynamic.rs
│ │ │ │ ├── mod.rs
│ │ │ │ ├── pretty.rs
│ │ │ │ ├── request_id.rs
│ │ │ │ └── visit.rs
│ │ │ └── traceable.rs
│ │ └── util/
│ │ ├── chain.rs
│ │ ├── join.rs
│ │ ├── mod.rs
│ │ ├── reader_stream.rs
│ │ └── unix.rs
│ └── tests/
│ ├── absolute-uris-okay-issue-443.rs
│ ├── adhoc-uri-normalizer.rs
│ ├── byte-slices-form-field-issue-2148.rs
│ ├── can-correct-bad-local-uri.rs
│ ├── can-launch-tls.rs
│ ├── catcher-cookies-1213.rs
│ ├── conditionally-set-server-header-996.rs
│ ├── config-proxy-proto-header.rs
│ ├── config-real-ip-header.rs
│ ├── config-secret-key-1500.rs
│ ├── content-length.rs
│ ├── cookies-private.rs
│ ├── derive-reexports.rs
│ ├── deserialize-limits-issue-2268.rs
│ ├── encoded-uris.rs
│ ├── fairing_before_head_strip-issue-546.rs
│ ├── file_server.rs
│ ├── flash-lazy-removes-issue-466.rs
│ ├── form-validation-names.rs
│ ├── form_method-issue-45.rs
│ ├── form_value_decoding-issue-82.rs
│ ├── form_value_from_encoded_str-issue-1425.rs
│ ├── forward-includes-status-1560.rs
│ ├── head_handling.rs
│ ├── http_serde.rs
│ ├── launch-inspect.rs
│ ├── limits.rs
│ ├── local-client-access-runtime-in-drop.rs
│ ├── local-client-json.rs
│ ├── local-request-content-type-issue-505.rs
│ ├── local_request_private_cookie-issue-368.rs
│ ├── many-cookie-jars-at-once.rs
│ ├── mapped-base-issue-1262.rs
│ ├── mount_point.rs
│ ├── msgpack_encoding.rs
│ ├── multipart-limit.rs
│ ├── nested-fairing-attaches.rs
│ ├── on_launch_fairing_can_inspect_port.rs
│ ├── panic-handling.rs
│ ├── precise-content-type-matching.rs
│ ├── raw-strings-multipart-files-1987.rs
│ ├── recursive-singleton-fairing.rs
│ ├── redirect_from_catcher-issue-113.rs
│ ├── replace-content-type-518.rs
│ ├── responder_lifetime-issue-345.rs
│ ├── route_guard.rs
│ ├── scoped-uri.rs
│ ├── segments-issues-41-86.rs
│ ├── sentinel.rs
│ ├── session-cookies-issue-1506.rs
│ ├── shield.rs
│ ├── shutdown-fairings.rs
│ ├── static/
│ │ ├── .hidden
│ │ ├── index.html
│ │ ├── inner/
│ │ │ ├── .hideme
│ │ │ ├── goodbye
│ │ │ └── index.html
│ │ └── other/
│ │ ├── hello.txt
│ │ └── index.htm
│ ├── strict_and_lenient_forms.rs
│ ├── timer-on-attach.rs
│ ├── tls-config-from-source-1503.rs
│ ├── twice_managed_state.rs
│ ├── typed-uri-docs-redef-issue-1373.rs
│ ├── unsound-local-request-1312.rs
│ ├── untracked-vs-tracked.rs
│ └── uri-percent-encoding-issue-808.rs
├── docs/
│ ├── LICENSE
│ ├── guide/
│ │ ├── 00-introduction.md
│ │ ├── 01-upgrading.md
│ │ ├── 02-quickstart.md
│ │ ├── 03-getting-started.md
│ │ ├── 04-overview.md
│ │ ├── 05-requests.md
│ │ ├── 06-responses.md
│ │ ├── 07-state.md
│ │ ├── 08-fairings.md
│ │ ├── 09-testing.md
│ │ ├── 10-configuration.md
│ │ ├── 11-deploying.md
│ │ ├── 12-pastebin.md
│ │ ├── 13-conclusion.md
│ │ ├── 14-faq.md
│ │ └── index.md
│ └── tests/
│ ├── Cargo.toml
│ └── src/
│ ├── guide.rs
│ ├── lib.rs
│ └── readme.rs
├── examples/
│ ├── Cargo.toml
│ ├── README.md
│ ├── chat/
│ │ ├── Cargo.toml
│ │ ├── src/
│ │ │ ├── main.rs
│ │ │ └── tests.rs
│ │ └── static/
│ │ ├── index.html
│ │ ├── reset.css
│ │ ├── script.js
│ │ └── style.css
│ ├── config/
│ │ ├── Cargo.toml
│ │ ├── Rocket.toml
│ │ └── src/
│ │ ├── main.rs
│ │ └── tests.rs
│ ├── cookies/
│ │ ├── Cargo.toml
│ │ ├── Rocket.toml
│ │ ├── src/
│ │ │ ├── main.rs
│ │ │ ├── message.rs
│ │ │ ├── session.rs
│ │ │ └── tests.rs
│ │ └── templates/
│ │ ├── login.html.hbs
│ │ ├── message.html.hbs
│ │ └── session.html.hbs
│ ├── databases/
│ │ ├── .sqlx/
│ │ │ ├── query-11e3096becb72f427c8d3911ef4327afd9516143806981e11f8e34d069c14472.json
│ │ │ ├── query-4415c35941e52a981b10707fe2e1ceb0bad0e473701e51ef21ecb2973c76b4df.json
│ │ │ ├── query-668690acaca0a0c0b4ac306b14d82aa1bee940f0776fae3f9962639b78328858.json
│ │ │ ├── query-79301b44b77802e0096efd73b1e9adac27b27a3cf7bf853af3a9f130b1684d91.json
│ │ │ └── query-bea4ef6e25064f6b383e854f8bc2770d89cfaf9859d0bfca78b2ca24627675b7.json
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── Rocket.toml
│ │ ├── db/
│ │ │ ├── diesel/
│ │ │ │ ├── migrations/
│ │ │ │ │ ├── .gitkeep
│ │ │ │ │ └── 20210329150332_create_posts_table/
│ │ │ │ │ ├── down.sql
│ │ │ │ │ └── up.sql
│ │ │ │ └── mysql-migrations/
│ │ │ │ └── 20210329150332_create_posts_table/
│ │ │ │ ├── down.sql
│ │ │ │ └── up.sql
│ │ │ └── sqlx/
│ │ │ └── migrations/
│ │ │ └── 20210331024424_create-posts-table.sql
│ │ └── src/
│ │ ├── diesel_mysql.rs
│ │ ├── diesel_sqlite.rs
│ │ ├── main.rs
│ │ ├── rusqlite.rs
│ │ ├── sqlx.rs
│ │ └── tests.rs
│ ├── error-handling/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── main.rs
│ │ └── tests.rs
│ ├── fairings/
│ │ ├── Cargo.toml
│ │ ├── Rocket.toml
│ │ └── src/
│ │ ├── main.rs
│ │ └── tests.rs
│ ├── forms/
│ │ ├── Cargo.toml
│ │ ├── Rocket.toml
│ │ ├── src/
│ │ │ ├── main.rs
│ │ │ └── tests.rs
│ │ └── templates/
│ │ ├── index.html.tera
│ │ ├── macros.html.tera
│ │ └── success.html.tera
│ ├── hello/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── main.rs
│ │ └── tests.rs
│ ├── manual-routing/
│ │ ├── Cargo.toml
│ │ ├── Rocket.toml
│ │ └── src/
│ │ ├── main.rs
│ │ └── tests.rs
│ ├── pastebin/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── main.rs
│ │ ├── paste_id.rs
│ │ └── tests.rs
│ ├── responders/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── main.rs
│ │ └── tests.rs
│ ├── serialization/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── json.rs
│ │ ├── main.rs
│ │ ├── msgpack.rs
│ │ ├── tests.rs
│ │ └── uuid.rs
│ ├── state/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── main.rs
│ │ ├── managed_hit_count.rs
│ │ ├── managed_queue.rs
│ │ ├── request_local.rs
│ │ └── tests.rs
│ ├── static-files/
│ │ ├── Cargo.toml
│ │ ├── src/
│ │ │ ├── main.rs
│ │ │ └── tests.rs
│ │ └── static/
│ │ ├── hidden/
│ │ │ ├── hi.txt
│ │ │ └── index.html
│ │ └── index.html
│ ├── templating/
│ │ ├── Cargo.toml
│ │ ├── Rocket.toml
│ │ ├── src/
│ │ │ ├── hbs.rs
│ │ │ ├── main.rs
│ │ │ ├── minijinja.rs
│ │ │ ├── tera.rs
│ │ │ └── tests.rs
│ │ └── templates/
│ │ ├── hbs/
│ │ │ ├── error/
│ │ │ │ └── 404.html.hbs
│ │ │ ├── footer.html.hbs
│ │ │ ├── index.html.hbs
│ │ │ ├── layout.html.hbs
│ │ │ └── nav.html.hbs
│ │ ├── minijinja/
│ │ │ ├── error/
│ │ │ │ └── 404.html.j2
│ │ │ ├── footer.html.j2
│ │ │ ├── index.html.j2
│ │ │ ├── layout.html.j2
│ │ │ └── nav.html.j2
│ │ └── tera/
│ │ ├── base.html.tera
│ │ ├── error/
│ │ │ └── 404.html.tera
│ │ ├── index.html.tera
│ │ └── nav.html.tera
│ ├── testing/
│ │ ├── Cargo.toml
│ │ └── src/
│ │ ├── async_required.rs
│ │ └── main.rs
│ ├── tls/
│ │ ├── Cargo.toml
│ │ ├── Rocket.toml
│ │ ├── private/
│ │ │ ├── ca_cert.pem
│ │ │ ├── ca_key.pem
│ │ │ ├── client.pem
│ │ │ ├── ecdsa_nistp256_sha256.p12
│ │ │ ├── ecdsa_nistp256_sha256_cert.pem
│ │ │ ├── ecdsa_nistp256_sha256_key_pkcs8.pem
│ │ │ ├── ecdsa_nistp256_sha256_key_sec1.pem
│ │ │ ├── ecdsa_nistp384_sha384.p12
│ │ │ ├── ecdsa_nistp384_sha384_cert.pem
│ │ │ ├── ecdsa_nistp384_sha384_key_pkcs8.pem
│ │ │ ├── ecdsa_nistp384_sha384_key_sec1.pem
│ │ │ ├── ecdsa_nistp521_sha512.p12
│ │ │ ├── ecdsa_nistp521_sha512_cert.pem
│ │ │ ├── ecdsa_nistp521_sha512_key_pkcs8.pem
│ │ │ ├── ed25519.p12
│ │ │ ├── ed25519_cert.pem
│ │ │ ├── ed25519_key.pem
│ │ │ ├── gen_certs.sh
│ │ │ ├── rsa_sha256.p12
│ │ │ ├── rsa_sha256_cert.pem
│ │ │ └── rsa_sha256_key.pem
│ │ └── src/
│ │ ├── main.rs
│ │ ├── redirector.rs
│ │ └── tests.rs
│ ├── todo/
│ │ ├── Cargo.toml
│ │ ├── README.md
│ │ ├── Rocket.toml
│ │ ├── db/
│ │ │ └── DB_LIVES_HERE
│ │ ├── migrations/
│ │ │ ├── .gitkeep
│ │ │ └── 20160720150332_create_tasks_table/
│ │ │ ├── down.sql
│ │ │ └── up.sql
│ │ ├── src/
│ │ │ ├── main.rs
│ │ │ ├── task.rs
│ │ │ └── tests.rs
│ │ └── static/
│ │ ├── css/
│ │ │ ├── normalize.css
│ │ │ ├── skeleton.css
│ │ │ └── style.css
│ │ └── index.html.tera
│ └── upgrade/
│ ├── Cargo.toml
│ ├── src/
│ │ └── main.rs
│ └── static/
│ └── index.html
├── scripts/
│ ├── config.sh
│ ├── mk-docs.sh
│ ├── publish.sh
│ └── test.sh
└── testbench/
├── Cargo.toml
└── src/
├── client.rs
├── config.rs
├── lib.rs
├── main.rs
├── runner.rs
├── server.rs
└── servers/
├── bind.rs
├── http_extensions.rs
├── ignite_failure.rs
├── infinite_stream.rs
├── mod.rs
├── mtls.rs
├── no_content.rs
├── sni_resolver.rs
├── tls.rs
├── tls_resolver.rs
└── tracing.rs
Showing preview only (352K chars total). Download the full file or copy to clipboard to get everything.
SYMBOL INDEX (4388 symbols across 412 files)
FILE: benchmarks/src/routing.rs
function dummy_handler (line 7) | fn dummy_handler<'r>(req: &'r Request, _: Data<'r>) -> route::BoxFuture<...
function parse_routes_table (line 11) | fn parse_routes_table(table: &str) -> Vec<Route> {
function generate_matching_requests (line 40) | fn generate_matching_requests<'c>(client: &'c Client, routes: &[Route]) ...
function client (line 78) | fn client(routes: Vec<Route>) -> Client {
function bench_rust_lang_routes (line 101) | pub fn bench_rust_lang_routes(c: &mut Criterion) {
function bench_bitwarden_routes (line 114) | pub fn bench_bitwarden_routes(c: &mut Criterion) {
FILE: contrib/db_pools/codegen/src/database.rs
constant ONE_DATABASE_ATTR (line 7) | const ONE_DATABASE_ATTR: &str = "missing `#[database(\"name\")]` attribu...
constant ONE_UNNAMED_FIELD (line 8) | const ONE_UNNAMED_FIELD: &str = "struct must have exactly one unnamed fi...
type DatabaseAttribute (line 11) | struct DatabaseAttribute {
function derive_database (line 16) | pub fn derive_database(input: TokenStream) -> TokenStream {
FILE: contrib/db_pools/codegen/src/lib.rs
function derive_database (line 59) | pub fn derive_database(input: proc_macro::TokenStream) -> proc_macro::To...
FILE: contrib/db_pools/codegen/tests/ui-fail.rs
function ui (line 3) | fn ui() {
FILE: contrib/db_pools/codegen/tests/ui-fail/database-syntax.rs
type A (line 5) | struct A(deadpool_postgres::Pool);
type B (line 9) | struct B(deadpool_postgres::Pool);
type C (line 13) | struct C(deadpool_postgres::Pool);
type D (line 17) | enum D { }
type E (line 20) | struct E(deadpool_postgres::Pool);
type F (line 24) | struct F;
type G (line 28) | struct G(deadpool_postgres::Pool, deadpool_postgres::Pool);
type H (line 32) | struct H {
function main (line 36) | fn main() { }
FILE: contrib/db_pools/codegen/tests/ui-fail/database-types.rs
type Unknown (line 3) | struct Unknown;
type A (line 7) | struct A(Unknown);
type B (line 11) | struct B(Vec<i32>);
function main (line 13) | fn main() { }
FILE: contrib/db_pools/lib/src/config.rs
type Config (line 55) | pub struct Config {
method default (line 98) | fn default() -> Self {
function default_values_sane (line 115) | fn default_values_sane() {
FILE: contrib/db_pools/lib/src/database.rs
type Database (line 34) | pub trait Database: From<Self::Pool> + DerefMut<Target = Self::Pool> + S...
constant NAME (line 45) | const NAME: &'static str;
method init (line 66) | fn init() -> Initializer<Self> {
method fetch (line 118) | fn fetch<P: Phase>(rocket: &Rocket<P>) -> Option<&Self> {
type Initializer (line 153) | pub struct Initializer<D: Database>(Option<&'static str>, PhantomData<fn...
type Connection (line 195) | pub struct Connection<D: Database>(<D::Pool as Pool>::Connection);
function new (line 202) | pub fn new() -> Self {
function with_name (line 210) | pub fn with_name(name: &'static str) -> Self {
function into_inner (line 241) | pub fn into_inner(self) -> <D::Pool as Pool>::Connection {
method info (line 248) | fn info(&self) -> Info {
method on_ignite (line 255) | async fn on_ignite(&self, rocket: Rocket<Build>) -> fairing::Result {
method on_shutdown (line 274) | async fn on_shutdown(&self, rocket: &Rocket<Orbit>) {
type Error (line 283) | type Error = Option<<D::Pool as Pool>::Error>;
function from_request (line 285) | async fn from_request(req: &'r Request<'_>) -> Outcome<Self, Self::Error> {
method abort (line 297) | fn abort(rocket: &Rocket<Ignite>) -> bool {
type Target (line 303) | type Target = <D::Pool as Pool>::Connection;
method deref (line 305) | fn deref(&self) -> &Self::Target {
method deref_mut (line 311) | fn deref_mut(&mut self) -> &mut Self::Target {
FILE: contrib/db_pools/lib/src/diesel.rs
type QueryResult (line 108) | pub type QueryResult<T, E = rocket::response::Debug<diesel::result::Erro...
type MysqlPool (line 130) | pub type MysqlPool = Pool<AsyncMysqlConnection>;
type PgPool (line 152) | pub type PgPool = Pool<AsyncPgConnection>;
FILE: contrib/db_pools/lib/src/error.rs
type Error (line 7) | pub enum Error<A, B = A> {
function fmt (line 19) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
function from (line 32) | fn from(e: crate::figment::Error) -> Self {
FILE: contrib/db_pools/lib/src/pool.rs
type Pool (line 117) | pub trait Pool: Sized + Send + 'static {
method init (line 136) | async fn init(figment: &Figment) -> Result<Self, Self::Error>;
method get (line 145) | async fn get(&self) -> Result<Self::Connection, Self::Error>;
method close (line 152) | async fn close(&self);
type DeadManager (line 163) | pub trait DeadManager: Manager + Sized + Send + 'static {
method new (line 164) | fn new(config: &Config) -> Result<Self, Self::Error>;
method new (line 169) | fn new(config: &Config) -> Result<Self, Self::Error> {
method new (line 176) | fn new(config: &Config) -> Result<Self, Self::Error> {
method new (line 183) | fn new(config: &Config) -> Result<Self, Self::Error> {
method new (line 190) | fn new(config: &Config) -> Result<Self, Self::Error> {
type Error (line 199) | type Error = Error<PoolError<M::Error>>;
type Connection (line 201) | type Connection = C;
function init (line 203) | async fn init(figment: &Figment) -> Result<Self, Self::Error> {
function get (line 217) | async fn get(&self) -> Result<Self::Connection, Self::Error> {
function close (line 221) | async fn close(&self) {
type Options (line 233) | type Options<D> = <<D as sqlx::Database>::Connection as sqlx::Connection...
function specialize (line 236) | fn specialize(__options: &mut dyn std::any::Any, __config: &Config) {
type Error (line 253) | type Error = Error<sqlx::Error>;
type Connection (line 255) | type Connection = sqlx::pool::PoolConnection<D>;
function init (line 257) | async fn init(figment: &Figment) -> Result<Self, Self::Error> {
function get (line 287) | async fn get(&self) -> Result<Self::Connection, Self::Error> {
function close (line 291) | async fn close(&self) {
type Error (line 304) | type Error = Error<mongodb::error::Error, std::convert::Infallible>;
type Connection (line 306) | type Connection = Client;
method init (line 308) | async fn init(figment: &Figment) -> Result<Self, Self::Error> {
method get (line 319) | async fn get(&self) -> Result<Self::Connection, Self::Error> {
method close (line 323) | async fn close(&self) {
FILE: contrib/dyn_templates/src/context.rs
type Callback (line 11) | pub(crate) type Callback =
type Context (line 14) | pub(crate) struct Context {
method initialize (line 29) | pub fn initialize(root: &Path, callback: &Callback) -> Option<Context> {
type ContextManager (line 107) | pub(crate) struct ContextManager(Context);
method new (line 110) | pub fn new(ctxt: Context) -> ContextManager {
method context (line 114) | pub fn context<'a>(&'a self) -> impl Deref<Target=Context> + 'a {
method is_reloading (line 118) | pub fn is_reloading(&self) -> bool {
method new (line 144) | pub fn new(ctxt: Context) -> ContextManager {
method context (line 163) | pub fn context(&self) -> impl Deref<Target=Context> + '_ {
method is_reloading (line 167) | pub fn is_reloading(&self) -> bool {
method context_mut (line 171) | fn context_mut(&self) -> impl DerefMut<Target=Context> + '_ {
method reload_if_needed (line 179) | pub fn reload_if_needed(&self, callback: &Callback) {
type ContextManager (line 136) | pub(crate) struct ContextManager {
method new (line 110) | pub fn new(ctxt: Context) -> ContextManager {
method context (line 114) | pub fn context<'a>(&'a self) -> impl Deref<Target=Context> + 'a {
method is_reloading (line 118) | pub fn is_reloading(&self) -> bool {
method new (line 144) | pub fn new(ctxt: Context) -> ContextManager {
method context (line 163) | pub fn context(&self) -> impl Deref<Target=Context> + '_ {
method is_reloading (line 167) | pub fn is_reloading(&self) -> bool {
method context_mut (line 171) | fn context_mut(&self) -> impl DerefMut<Target=Context> + '_ {
method reload_if_needed (line 179) | pub fn reload_if_needed(&self, callback: &Callback) {
function remove_extension (line 198) | fn remove_extension(path: &Path) -> PathBuf {
function split_path (line 212) | fn split_path(root: &Path, path: &Path) -> (String, Option<String>) {
function template_path_index_html (line 231) | fn template_path_index_html() {
function template_path_subdir_index_html (line 244) | fn template_path_subdir_index_html() {
function template_path_doc_examples (line 260) | fn template_path_doc_examples() {
FILE: contrib/dyn_templates/src/engine/handlebars.rs
constant EXT (line 9) | const EXT: &'static str = "hbs";
method init (line 11) | fn init<'a>(templates: impl Iterator<Item = (&'a str, &'a Path)>) -> Opt...
method render (line 26) | fn render<C: Serialize>(&self, template: &str, context: C) -> Option<Str...
FILE: contrib/dyn_templates/src/engine/minijinja.rs
constant EXT (line 11) | const EXT: &'static str = "j2";
method init (line 13) | fn init<'a>(templates: impl Iterator<Item = (&'a str, &'a Path)>) -> Opt...
method render (line 45) | fn render<C: Serialize>(&self, template: &str, context: C) -> Option<Str...
FILE: contrib/dyn_templates/src/engine/mod.rs
type Engine (line 23) | pub(crate) trait Engine: Send + Sync + Sized + 'static {
constant EXT (line 24) | const EXT: &'static str;
method init (line 26) | fn init<'a>(templates: impl Iterator<Item = (&'a str, &'a Path)>) -> O...
method render (line 27) | fn render<C: Serialize>(&self, name: &str, context: C) -> Option<String>;
type Engines (line 66) | pub struct Engines {
constant ENABLED_EXTENSIONS (line 95) | pub(crate) const ENABLED_EXTENSIONS: &'static [&'static str] = &[
method init (line 101) | pub(crate) fn init(templates: &HashMap<String, TemplateInfo>) -> Optio...
method render (line 130) | pub(crate) fn render<C: Serialize>(
method templates (line 158) | pub(crate) fn templates(&self) -> impl Iterator<Item = (&str, &'static...
FILE: contrib/dyn_templates/src/engine/tera.rs
constant EXT (line 10) | const EXT: &'static str = "tera";
method init (line 12) | fn init<'a>(templates: impl Iterator<Item = (&'a str, &'a Path)>) -> Opt...
method render (line 38) | fn render<C: Serialize>(&self, template: &str, context: C) -> Option<Str...
FILE: contrib/dyn_templates/src/fairing.rs
type TemplateFairing (line 14) | pub struct TemplateFairing {
method info (line 23) | fn info(&self) -> Info {
method on_ignite (line 35) | async fn on_ignite(&self, rocket: Rocket<Build>) -> fairing::Result {
method on_liftoff (line 57) | async fn on_liftoff(&self, rocket: &Rocket<Orbit>) {
method on_request (line 68) | async fn on_request(&self, req: &mut rocket::Request<'_>, _data: &mut ro...
FILE: contrib/dyn_templates/src/metadata.rs
type Metadata (line 41) | pub struct Metadata<'a>(&'a ContextManager);
function contains_template (line 61) | pub fn contains_template(&self, name: &str) -> bool {
function reloading (line 81) | pub fn reloading(&self) -> bool {
function render (line 120) | pub fn render<S, C>(&self, name: S, context: C) -> Option<(ContentType, ...
function fmt (line 128) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method abort (line 136) | fn abort(rocket: &Rocket<Ignite>) -> bool {
type Error (line 155) | type Error = ();
function from_request (line 157) | async fn from_request(request: &'r Request<'_>) -> request::Outcome<Self...
FILE: contrib/dyn_templates/src/template.rs
constant DEFAULT_TEMPLATE_DIR (line 17) | pub(crate) const DEFAULT_TEMPLATE_DIR: &str = "templates";
type Template (line 27) | pub struct Template {
method fairing (line 73) | pub fn fairing() -> impl Fairing {
method custom (line 104) | pub fn custom<F: Send + Sync + 'static>(f: F) -> impl Fairing
method try_custom (line 136) | pub fn try_custom<F: Send + Sync + 'static>(f: F) -> impl Fairing
method render (line 175) | pub fn render<S, C>(name: S, context: C) -> Template
method show (line 218) | pub fn show<S, C>(rocket: &Rocket<Orbit>, name: S, context: C) -> Opti...
method finalize (line 238) | pub(crate) fn finalize(self, ctxt: &Context) -> Result<(ContentType, S...
method respond_to (line 268) | fn respond_to(self, req: &'r Request<'_>) -> response::Result<'static> {
type TemplateInfo (line 33) | pub(crate) struct TemplateInfo {
method abort (line 285) | fn abort(rocket: &Rocket<Ignite>) -> bool {
FILE: contrib/dyn_templates/tests/templates.rs
function template_check (line 12) | fn template_check(md: Metadata<'_>, engine: &str, name: &str) -> Option<...
function is_reloading (line 17) | fn is_reloading(md: Metadata<'_>) -> Option<()> {
function template_root (line 21) | fn template_root() -> PathBuf {
function rocket (line 25) | fn rocket() -> Rocket<Build> {
function test_callback_error (line 32) | fn test_callback_error() {
function test_sentinel (line 47) | fn test_sentinel() {
function test_context_macro (line 101) | fn test_context_macro() {
constant UNESCAPED_EXPECTED (line 211) | const UNESCAPED_EXPECTED: &'static str
constant ESCAPED_EXPECTED (line 213) | const ESCAPED_EXPECTED: &'static str
function test_tera_templates (line 217) | async fn test_tera_templates() {
function test_globby_paths (line 242) | async fn test_globby_paths() {
function test_template_metadata_with_tera (line 267) | fn test_template_metadata_with_tera() {
function test_handlebars_templates (line 295) | async fn test_handlebars_templates() {
function test_template_metadata_with_handlebars (line 332) | fn test_template_metadata_with_handlebars() {
function test_template_reload (line 349) | fn test_template_reload() {
constant UNESCAPED_EXPECTED (line 412) | const UNESCAPED_EXPECTED: &'static str
constant ESCAPED_EXPECTED (line 414) | const ESCAPED_EXPECTED: &'static str
function test_j2_templates (line 418) | async fn test_j2_templates() {
function test_globby_paths (line 443) | async fn test_globby_paths() {
function test_j2_u128 (line 453) | fn test_j2_u128() {
function test_template_metadata_with_j2 (line 469) | fn test_template_metadata_with_j2() {
FILE: contrib/sync_db_pools/codegen/src/database.rs
type DatabaseInvocation (line 7) | struct DatabaseInvocation {
constant EXAMPLE (line 20) | const EXAMPLE: &str = "example: `struct MyDatabase(diesel::SqliteConnect...
constant ONLY_ON_STRUCTS_MSG (line 21) | const ONLY_ON_STRUCTS_MSG: &str = "`database` attribute can only be used...
constant ONLY_UNNAMED_FIELDS (line 22) | const ONLY_UNNAMED_FIELDS: &str = "`database` attribute can only be appl...
constant NO_GENERIC_STRUCTS (line 24) | const NO_GENERIC_STRUCTS: &str = "`database` attribute cannot be applied...
function parse_invocation (line 27) | fn parse_invocation(attr: TokenStream, input: TokenStream) -> Result<Dat...
function database_attr (line 59) | pub fn database_attr(attr: TokenStream, input: TokenStream) -> Result<To...
FILE: contrib/sync_db_pools/codegen/src/lib.rs
function database (line 53) | pub fn database(attr: TokenStream, input: TokenStream) -> TokenStream {
FILE: contrib/sync_db_pools/codegen/tests/ui-fail.rs
function ui (line 3) | fn ui() {
FILE: contrib/sync_db_pools/codegen/tests/ui-fail/database-syntax.rs
type Connection (line 3) | struct Connection;
type Manager (line 4) | struct Manager;
type Connection (line 10) | type Connection = Connection;
type Error (line 11) | type Error = std::convert::Infallible;
method connect (line 13) | fn connect(&self) -> Result<Self::Connection, Self::Error> { Ok(Connec...
method is_valid (line 14) | fn is_valid(&self, _: &mut Self::Connection) -> Result<(), Self::Error...
method has_broken (line 15) | fn has_broken(&self, _: &mut Self::Connection) -> bool { true }
type Manager (line 19) | type Manager = Manager;
type Error (line 20) | type Error = std::convert::Infallible;
method pool (line 22) | fn pool(_: &str, _: &Rocket<Build>) -> PoolResult<Self> {
type A (line 28) | struct A(Connection);
type B (line 31) | struct B(Connection);
type C (line 34) | struct C(Connection);
type D (line 37) | struct D(Connection);
type Foo (line 40) | enum Foo { }
type Bar (line 43) | struct Bar(Connection, Connection);
type E (line 49) | struct E<'r>(&'r str);
type F (line 52) | struct F<T>(T);
function main (line 54) | fn main() { }
FILE: contrib/sync_db_pools/codegen/tests/ui-fail/database-types.rs
type Unknown (line 3) | struct Unknown;
type A (line 6) | struct A(Unknown);
type B (line 9) | struct B(Vec<i32>);
function main (line 11) | fn main() { }
FILE: contrib/sync_db_pools/lib/build.rs
function main (line 1) | fn main() {
FILE: contrib/sync_db_pools/lib/src/config.rs
type Config (line 33) | pub struct Config {
method from (line 85) | pub fn from(db_name: &str, rocket: &Rocket<Build>) -> Result<Config, f...
method figment (line 103) | pub fn figment(db_name: &str, rocket: &Rocket<Build>) -> Figment {
FILE: contrib/sync_db_pools/lib/src/connection.rs
type ConnectionPool (line 21) | pub struct ConnectionPool<K, C: Poolable> {
method clone (line 30) | fn clone(&self) -> Self {
type Connection (line 45) | pub struct Connection<K, C: Poolable> {
function run_blocking (line 52) | async fn run_blocking<F, R>(job: F) -> R
function fairing (line 65) | pub fn fairing(fairing_name: &'static str, database: &'static str) -> im...
function get (line 101) | pub async fn get(&self) -> Option<Connection<K, C>> {
function get_one (line 129) | pub async fn get_one<P: Phase>(rocket: &Rocket<P>) -> Option<Connection<...
function pool (line 146) | pub fn pool<P: Phase>(rocket: &Rocket<P>) -> Option<&Self> {
function run (line 152) | pub async fn run<F, R>(&self, f: F) -> R
method drop (line 181) | fn drop(&mut self) {
method drop (line 214) | fn drop(&mut self) {
type Error (line 226) | type Error = ();
function from_request (line 229) | async fn from_request(request: &'r Request<'_>) -> Outcome<Self, ()> {
method abort (line 243) | fn abort(rocket: &Rocket<Ignite>) -> bool {
FILE: contrib/sync_db_pools/lib/src/error.rs
type Error (line 10) | pub enum Error<T> {
function from (line 20) | fn from(error: figment::Error) -> Self {
function from (line 26) | fn from(error: r2d2::Error) -> Self {
FILE: contrib/sync_db_pools/lib/src/lib.rs
type ExampleDb (line 405) | pub struct ExampleDb(crate::Connection<Self, diesel::SqliteConnection>);
method fairing (line 432) | pub fn fairing() -> impl crate::rocket::fairing::Fairing {
method pool (line 488) | pub fn pool<P: crate::rocket::Phase>(
method run (line 523) | pub async fn run<F, R>(&self, __f: F) -> R
method get_one (line 534) | pub async fn get_one<P: crate::rocket::Phase>(
type Error (line 548) | type Error = ();
method from_request (line 557) | fn from_request<'life0, 'async_trait>(
method abort (line 589) | fn abort(
FILE: contrib/sync_db_pools/lib/src/poolable.rs
type Poolable (line 101) | pub trait Poolable: Send + Sized + 'static {
method pool (line 111) | fn pool(db_name: &str, rocket: &Rocket<Build>) -> PoolResult<Self>;
type Manager (line 120) | type Manager = diesel::r2d2::ConnectionManager<diesel::SqliteConnection>;
type Error (line 121) | type Error = std::convert::Infallible;
method pool (line 123) | fn pool(db_name: &str, rocket: &Rocket<Build>) -> PoolResult<Self> {
type Manager (line 156) | type Manager = diesel::r2d2::ConnectionManager<diesel::PgConnection>;
type Error (line 157) | type Error = std::convert::Infallible;
method pool (line 159) | fn pool(db_name: &str, rocket: &Rocket<Build>) -> PoolResult<Self> {
type Manager (line 173) | type Manager = diesel::r2d2::ConnectionManager<diesel::MysqlConnection>;
type Error (line 174) | type Error = std::convert::Infallible;
method pool (line 176) | fn pool(db_name: &str, rocket: &Rocket<Build>) -> PoolResult<Self> {
type Manager (line 191) | type Manager = r2d2_postgres::PostgresConnectionManager<postgres::tls:...
type Error (line 192) | type Error = postgres::Error;
method pool (line 194) | fn pool(db_name: &str, rocket: &Rocket<Build>) -> PoolResult<Self> {
type Manager (line 209) | type Manager = r2d2_sqlite::SqliteConnectionManager;
type Error (line 210) | type Error = std::convert::Infallible;
method pool (line 212) | fn pool(db_name: &str, rocket: &Rocket<Build>) -> PoolResult<Self> {
type PoolResult (line 116) | pub type PoolResult<P: Poolable> = Result<r2d2::Pool<P::Manager>, Error<...
type ConnectionManager (line 273) | pub struct ConnectionManager {
method new (line 278) | pub fn new<C: Connectable>(target: C) -> Self {
type Connection (line 284) | type Connection = Client;
type Error (line 285) | type Error = MemcacheError;
method connect (line 287) | fn connect(&self) -> Result<Client, MemcacheError> {
method is_valid (line 291) | fn is_valid(&self, connection: &mut Client) -> Result<(), MemcacheErro...
method has_broken (line 295) | fn has_broken(&self, _connection: &mut Client) -> bool {
type Manager (line 301) | type Manager = ConnectionManager;
type Error (line 302) | type Error = MemcacheError;
function pool (line 304) | fn pool(db_name: &str, rocket: &Rocket<Build>) -> PoolResult<Self> {
FILE: contrib/sync_db_pools/lib/tests/databases.rs
type ExampleDb (line 8) | struct ExampleDb(diesel::SqliteConnection);
type PrimaryDb (line 11) | struct PrimaryDb(diesel::PgConnection);
type MemcacheDb (line 21) | struct MemcacheDb(memcache::Client);
type SqliteDb (line 32) | struct SqliteDb(pub rusqlite::Connection);
type SqliteDb2 (line 36) | struct SqliteDb2(pub rusqlite::Connection);
function test_db (line 39) | async fn test_db() {
type ContainsRuntime (line 78) | struct ContainsRuntime(Runtime);
type TestConnection (line 79) | struct TestConnection;
type Connection (line 82) | type Connection = TestConnection;
type Error (line 83) | type Error = std::convert::Infallible;
method connect (line 85) | fn connect(&self) -> Result<Self::Connection, Self::Error> {
method is_valid (line 89) | fn is_valid(&self, _conn: &mut Self::Connection) -> Result<(), Self::Err...
method has_broken (line 93) | fn has_broken(&self, _conn: &mut Self::Connection) -> bool {
type Manager (line 99) | type Manager = ContainsRuntime;
type Error (line 100) | type Error = ();
method pool (line 102) | fn pool(_db_name: &str, _rocket: &Rocket<Build>) -> PoolResult<Self> {
type TestDb (line 109) | struct TestDb(TestConnection);
function test_drop_runtime (line 112) | async fn test_drop_runtime() {
function test_sentinel (line 123) | fn test_sentinel() {
FILE: contrib/sync_db_pools/lib/tests/drop-with-connection.rs
type ExampleDb (line 7) | struct ExampleDb(diesel::SqliteConnection);
function can_drop_connection_in_sync_context (line 10) | fn can_drop_connection_in_sync_context() {
FILE: contrib/sync_db_pools/lib/tests/shutdown.rs
type Pool (line 8) | struct Pool(diesel::SqliteConnection);
function rocket (line 10) | async fn rocket() -> Rocket<Build> {
function test_shutdown (line 22) | fn test_shutdown() {
FILE: contrib/ws/src/duplex.rs
type DuplexStream (line 36) | pub struct DuplexStream(tokio_tungstenite::WebSocketStream<IoStream>);
method new (line 39) | pub(crate) async fn new(stream: IoStream, config: crate::Config) -> Se...
method close (line 48) | pub async fn close(&mut self, msg: Option<CloseFrame<'_>>) -> Result<(...
type Error (line 72) | type Error = Error;
method poll_ready (line 74) | fn poll_ready(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Resu...
method start_send (line 78) | fn start_send(self: Pin<&mut Self>, item: Message) -> Result<(), Self:...
method poll_flush (line 82) | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Resu...
method poll_close (line 86) | fn poll_close(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Resu...
type Item (line 54) | type Item = Result<Message>;
method poll_next (line 56) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
method size_hint (line 60) | fn size_hint(&self) -> (usize, Option<usize>) {
method is_terminated (line 66) | fn is_terminated(&self) -> bool {
FILE: contrib/ws/src/websocket.rs
type WebSocket (line 33) | pub struct WebSocket {
method config (line 61) | pub fn config(mut self, config: Config) -> Self {
method channel (line 112) | pub fn channel<'r, F>(self, handler: F) -> Channel<'r>
method stream (line 152) | pub fn stream<'r, F, S>(self, stream: F) -> MessageStream<'r, S>
method accept_key (line 186) | pub fn accept_key(&self) -> &str {
type Error (line 216) | type Error = std::convert::Infallible;
method from_request (line 218) | async fn from_request(req: &'r Request<'_>) -> Outcome<Self, Self::Err...
type Channel (line 195) | pub struct Channel<'r> {
type MessageStream (line 209) | pub struct MessageStream<'r, S> {
function respond_to (line 241) | fn respond_to(self, _: &'r Request<'_>) -> response::Result<'o> {
function respond_to (line 253) | fn respond_to(self, _: &'r Request<'_>) -> response::Result<'o> {
method io (line 264) | async fn io(self: Box<Self>, io: IoStream) -> io::Result<()> {
method io (line 275) | async fn io(self: Box<Self>, io: IoStream) -> io::Result<()> {
function handle_result (line 297) | fn handle_result(result: Result<()>) -> io::Result<bool> {
FILE: core/codegen/src/attribute/async_bound/mod.rs
function _async_bound (line 8) | fn _async_bound(
function async_bound (line 58) | pub fn async_bound(
FILE: core/codegen/src/attribute/catch/mod.rs
function _catch (line 11) | pub fn _catch(
function catch_attribute (line 98) | pub fn catch_attribute(
FILE: core/codegen/src/attribute/catch/parse.rs
type Attribute (line 8) | pub struct Attribute {
method parse (line 45) | pub fn parse(args: TokenStream, input: proc_macro::TokenStream) -> Res...
type Meta (line 17) | struct Meta {
type Code (line 24) | struct Code(Option<http::Status>);
method from_meta (line 27) | fn from_meta(meta: &MetaItem) -> Result<Self> {
FILE: core/codegen/src/attribute/entry/launch.rs
type Launch (line 12) | pub struct Launch;
function likely_spawns (line 15) | fn likely_spawns(f: &syn::ItemFn) -> Option<&syn::ExprCall> {
constant REQUIRES_ASYNC (line 57) | const REQUIRES_ASYNC: bool = false;
method function (line 59) | fn function(f: &mut syn::ItemFn) -> Result<TokenStream> {
FILE: core/codegen/src/attribute/entry/main.rs
type Main (line 10) | pub struct Main;
constant REQUIRES_ASYNC (line 13) | const REQUIRES_ASYNC: bool = true;
method function (line 15) | fn function(f: &mut syn::ItemFn) -> Result<TokenStream> {
FILE: core/codegen/src/attribute/entry/mod.rs
type EntryAttr (line 12) | trait EntryAttr {
constant REQUIRES_ASYNC (line 14) | const REQUIRES_ASYNC: bool;
method function (line 17) | fn function(f: &mut syn::ItemFn) -> Result<TokenStream>;
function _async_entry (line 20) | fn _async_entry<A: EntryAttr>(
FILE: core/codegen/src/attribute/entry/test.rs
type Test (line 7) | pub struct Test;
constant REQUIRES_ASYNC (line 10) | const REQUIRES_ASYNC: bool = true;
method function (line 12) | fn function(f: &mut syn::ItemFn) -> Result<TokenStream> {
FILE: core/codegen/src/attribute/param/guard.rs
method is_wild (line 11) | pub fn is_wild(&self) -> bool {
method from_meta (line 17) | fn from_meta(meta: &MetaItem) -> Result<Self> {
method eq (line 27) | fn eq(&self, other: &Dynamic) -> bool {
method hash (line 35) | fn hash<H: Hasher>(&self, state: &mut H) {
FILE: core/codegen/src/attribute/param/mod.rs
type Parameter (line 9) | pub enum Parameter {
method r#static (line 31) | pub fn r#static(&self) -> Option<&Name> {
method ignored (line 38) | pub fn ignored(&self) -> Option<&Dynamic> {
method take_dynamic (line 45) | pub fn take_dynamic(self) -> Option<Dynamic> {
method dynamic (line 53) | pub fn dynamic(&self) -> Option<&Dynamic> {
method dynamic_mut (line 61) | pub fn dynamic_mut(&mut self) -> Option<&mut Dynamic> {
method guard (line 69) | pub fn guard(&self) -> Option<&Guard> {
type Dynamic (line 17) | pub struct Dynamic {
method is_wild (line 79) | pub fn is_wild(&self) -> bool {
type Guard (line 24) | pub struct Guard {
method from (line 85) | pub fn from(source: Dynamic, fn_ident: syn::Ident, ty: syn::Type) -> S...
FILE: core/codegen/src/attribute/param/parse.rs
type Error (line 12) | pub struct Error<'a> {
type ErrorKind (line 21) | pub enum ErrorKind {
method fmt (line 126) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
method parse (line 31) | pub fn parse<P: Part>(
method parse (line 44) | pub fn parse<P: Part>(
method parse_many (line 90) | pub fn parse_many<P: Part>(
function new (line 139) | pub fn new(segment: &str, span: Span, kind: ErrorKind) -> Error<'_> {
function source (line 143) | pub fn source(mut self, source: &'a str, span: Span) -> Self {
method from (line 151) | fn from(error: Error<'_>) -> Self {
method from_meta (line 185) | fn from_meta(meta: &devise::MetaItem) -> devise::Result<Self> {
function subspan (line 200) | fn subspan(needle: &str, haystack: &str, span: Span) -> Span {
function trailspan (line 205) | fn trailspan(needle: &str, haystack: &str, span: Span) -> Span {
function candidate_from_malformed (line 215) | fn candidate_from_malformed(segment: &str) -> String {
function is_ident_start (line 229) | fn is_ident_start(c: char) -> bool {
function is_ident_continue (line 236) | fn is_ident_continue(c: char) -> bool {
function is_valid_ident (line 242) | fn is_valid_ident(string: &str) -> bool {
FILE: core/codegen/src/attribute/route/mod.rs
method guards (line 20) | pub fn guards(&self) -> impl Iterator<Item = &Guard> {
method param_guards (line 27) | pub fn param_guards(&self) -> impl Iterator<Item = &Guard> {
method query_guards (line 31) | pub fn query_guards(&self) -> impl Iterator<Item = &Guard> {
function query_decls (line 36) | fn query_decls(route: &Route) -> Option<TokenStream> {
function request_guard_decl (line 125) | fn request_guard_decl(guard: &Guard) -> TokenStream {
function param_guard_decl (line 163) | fn param_guard_decl(guard: &Guard) -> TokenStream {
function data_guard_decl (line 220) | fn data_guard_decl(guard: &Guard) -> TokenStream {
function internal_uri_macro_decl (line 256) | fn internal_uri_macro_decl(route: &Route) -> TokenStream {
function responder_outcome_expr (line 297) | fn responder_outcome_expr(route: &Route) -> TokenStream {
function sentinels_expr (line 317) | fn sentinels_expr(route: &Route) -> TokenStream {
function codegen_route (line 379) | fn codegen_route(route: Route) -> Result<TokenStream> {
function complete_route (line 452) | fn complete_route(args: TokenStream, input: TokenStream) -> Result<Token...
function incomplete_route (line 462) | fn incomplete_route(
function route_attribute (line 498) | pub fn route_attribute<M: Into<Option<crate::http::Method>>>(
FILE: core/codegen/src/attribute/route/parse.rs
type Route (line 17) | pub struct Route {
method upgrade_param (line 106) | pub fn upgrade_param(param: Parameter, args: &Arguments) -> Result<Par...
method upgrade_dynamic (line 115) | pub fn upgrade_dynamic(param: Dynamic, args: &Arguments) -> Result<Gua...
method from (line 125) | pub fn from(attr: Attribute, handler: syn::ItemFn) -> Result<Route> {
type ArgumentMap (line 34) | type ArgumentMap = IndexMap<Name, (syn::Ident, syn::Type)>;
type Arguments (line 37) | pub struct Arguments {
type Attribute (line 44) | pub struct Attribute {
type MethodAttribute (line 55) | pub struct MethodAttribute {
type RouteUri (line 64) | pub struct RouteUri {
type Target (line 234) | type Target = Origin<'static>;
method deref (line 236) | fn deref(&self) -> &Self::Target {
method from_meta (line 71) | fn from_meta(meta: &devise::MetaItem) -> Result<Self> {
FILE: core/codegen/src/attribute/suppress/lint.rs
function span_to_range (line 50) | fn span_to_range(span: Span) -> Option<Range<usize>> {
method suppress_attrs (line 59) | pub fn suppress_attrs(attrs: &[syn::Attribute], ctxt: Span) {
method suppress_attr (line 63) | pub fn suppress_attr(attr: &syn::Attribute, ctxt: Span) -> Result<(), sy...
method suppress_tokens (line 75) | pub fn suppress_tokens(attr_tokens: TokenStream, ctxt: Span) -> Result<(...
method suppress (line 81) | pub fn suppress(self, ctxt: Span) {
method is_suppressed (line 88) | pub fn is_suppressed(self, ctxt: Span) -> bool {
method enabled (line 97) | pub fn enabled(self, ctxt: Span) -> bool {
method how_to_suppress (line 101) | pub fn how_to_suppress(self) -> String {
method parse (line 107) | fn parse(input: syn::parse::ParseStream<'_>) -> syn::Result<Self> {
FILE: core/codegen/src/attribute/suppress/mod.rs
function suppress_attribute (line 8) | pub fn suppress_attribute(
FILE: core/codegen/src/bang/export.rs
function _macro (line 9) | pub fn _macro(input: proc_macro::TokenStream) -> devise::Result<TokenStr...
FILE: core/codegen/src/bang/mod.rs
function struct_maker_vec (line 13) | fn struct_maker_vec(
function routes_macro (line 37) | pub fn routes_macro(input: proc_macro::TokenStream) -> TokenStream {
function catchers_macro (line 42) | pub fn catchers_macro(input: proc_macro::TokenStream) -> TokenStream {
function uri_macro (line 47) | pub fn uri_macro(input: proc_macro::TokenStream) -> TokenStream {
function uri_internal_macro (line 54) | pub fn uri_internal_macro(input: proc_macro::TokenStream) -> TokenStream {
function guide_tests_internal (line 66) | pub fn guide_tests_internal(input: proc_macro::TokenStream) -> TokenStre...
function export_internal (line 71) | pub fn export_internal(input: proc_macro::TokenStream) -> TokenStream {
function typed_stream (line 76) | pub fn typed_stream(input: proc_macro::TokenStream) -> TokenStream {
FILE: core/codegen/src/bang/test_guide.rs
function _macro (line 8) | pub fn _macro(input: proc_macro::TokenStream) -> devise::Result<TokenStr...
function entry_to_tests (line 16) | fn entry_to_tests(root_glob: &LitStr) -> Result<Vec<TokenStream>, Box<dy...
FILE: core/codegen/src/bang/typed_stream.rs
type Input (line 5) | pub enum Input {
type Invocation (line 11) | struct Invocation {
function trait_obj_recast (line 19) | fn trait_obj_recast(ty: &syn::Type) -> Option<(syn::Type, syn::Token![+]...
method parse (line 40) | fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
method parse (line 69) | fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
function _macro (line 83) | pub fn _macro(input: proc_macro::TokenStream) -> devise::Result<TokenStr...
FILE: core/codegen/src/bang/uri.rs
function prefix_last_segment (line 25) | pub fn prefix_last_segment(path: &mut syn::Path, prefix: &str) {
function _uri_macro (line 30) | pub fn _uri_macro(input: TokenStream) -> Result<TokenStream> {
function extract_exprs (line 42) | fn extract_exprs(internal: &InternalUriParams) -> Result<(
function add_binding (line 119) | fn add_binding<P: fmt::Part>(to: &mut Vec<TokenStream>, ident: &Ident, t...
function explode_path (line 135) | fn explode_path<'a>(
function explode_query (line 168) | fn explode_query<'a>(
function _uri_internal_macro (line 224) | pub fn _uri_internal_macro(input: TokenStream) -> Result<TokenStream> {
FILE: core/codegen/src/bang/uri_parsing.rs
type ArgExpr (line 21) | pub enum ArgExpr {
method as_expr (line 451) | pub fn as_expr(&self) -> Option<&Expr> {
method unwrap_expr (line 458) | pub fn unwrap_expr(&self) -> &Expr {
type Arg (line 27) | pub enum Arg {
method is_named (line 423) | fn is_named(&self) -> bool {
method unnamed (line 427) | fn unnamed(&self) -> &ArgExpr {
method named (line 434) | fn named(&self) -> (&Name, &Ident, &ArgExpr) {
type Args (line 33) | pub enum Args {
method num (line 443) | fn num(&self) -> usize {
type UriLit (line 40) | pub struct UriLit(Uri<'static>, Span);
type UriExpr (line 44) | pub enum UriExpr {
method parse_prefix (line 472) | fn parse_prefix(input: ParseStream<'_>) -> syn::Result<Option<Self>> {
method parse_suffix (line 496) | fn parse_suffix(input: ParseStream<'_>) -> syn::Result<Option<Self>> {
type RouteInvocation (line 53) | pub struct RouteInvocation {
type RoutedUri (line 60) | pub struct RoutedUri {
method args_span (line 414) | pub fn args_span(&self) -> Span {
type UriMacro (line 80) | pub enum UriMacro {
method unary (line 217) | fn unary(input: ParseStream<'_>) -> parse::Result<Self> {
method binary (line 229) | fn binary(prefix: TokenStream, middle: TokenStream) -> parse::Result<S...
method ternary (line 237) | fn ternary(prefix: TokenStream, mid: TokenStream, suffix: TokenStream)...
type Validation (line 86) | pub enum Validation<'a> {
type InternalUriParams (line 115) | pub struct InternalUriParams {
method fn_args_str (line 342) | pub fn fn_args_str(&self) -> String {
method dynamic_path_params (line 354) | pub fn dynamic_path_params(&self) -> impl Iterator<Item = &Dynamic> + ...
method dynamic_query_params (line 359) | pub fn dynamic_query_params(&self) -> impl Iterator<Item = &Dynamic> +...
method validate (line 363) | pub fn validate(&self) -> Validation<'_> {
type FnArg (line 124) | pub struct FnArg {
function err (line 129) | fn err<T, S: AsRef<str>>(span: Span, s: S) -> parse::Result<T> {
method parse (line 134) | fn parse(input: ParseStream<'_>) -> parse::Result<Self> {
method parse (line 144) | fn parse(input: ParseStream<'_>) -> parse::Result<Self> {
method parse (line 159) | fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
method parse (line 187) | fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
method parse (line 202) | fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
method parse (line 247) | fn parse(input: ParseStream<'_>) -> parse::Result<Self> {
method parse (line 286) | fn parse(input: ParseStream<'_>) -> syn::Result<Self> {
method parse (line 295) | fn parse(input: ParseStream<'_>) -> parse::Result<FnArg> {
method parse (line 305) | fn parse(input: ParseStream<'_>) -> parse::Result<InternalUriParams> {
function uri_err (line 466) | fn uri_err<T>(lit: &StringLit, error: Error<'_>) -> parse::Result<T> {
type Target (line 533) | type Target = Uri<'static>;
method deref (line 535) | fn deref(&self) -> &Self::Target {
method to_tokens (line 541) | fn to_tokens(&self, t: &mut TokenStream) {
method to_tokens (line 556) | fn to_tokens(&self, t: &mut TokenStream) {
method to_tokens (line 565) | fn to_tokens(&self, tokens: &mut TokenStream) {
method to_tokens (line 574) | fn to_tokens(&self, tokens: &mut TokenStream) {
method to_tokens (line 587) | fn to_tokens(&self, tokens: &mut TokenStream) {
FILE: core/codegen/src/derive/form_field.rs
type FieldName (line 21) | pub enum FieldName {
type Target (line 134) | type Target = Name;
method deref (line 136) | fn deref(&self) -> &Self::Target {
type FieldAttr (line 27) | pub struct FieldAttr {
constant NAME (line 35) | const NAME: &'static str = "field";
type FieldExt (line 38) | pub(crate) trait FieldExt {
method ident (line 39) | fn ident(&self) -> Option<&syn::Ident>;
method member (line 40) | fn member(&self) -> syn::Member;
method context_ident (line 41) | fn context_ident(&self) -> syn::Ident;
method field_names (line 42) | fn field_names(&self) -> Result<Vec<FieldName>>;
method first_field_name (line 43) | fn first_field_name(&self) -> Result<Option<FieldName>>;
method stripped_ty (line 44) | fn stripped_ty(&self) -> syn::Type;
method name_buf_opt (line 45) | fn name_buf_opt(&self) -> Result<TokenStream>;
method ident (line 169) | fn ident(&self) -> Option<&syn::Ident> {
method member (line 173) | fn member(&self) -> syn::Member {
method context_ident (line 185) | fn context_ident(&self) -> syn::Ident {
method field_names (line 190) | fn field_names(&self) -> Result<Vec<FieldName>> {
method first_field_name (line 205) | fn first_field_name(&self) -> Result<Option<FieldName>> {
method stripped_ty (line 209) | fn stripped_ty(&self) -> syn::Type {
method name_buf_opt (line 213) | fn name_buf_opt(&self) -> Result<TokenStream> {
type VariantAttr (line 49) | pub struct VariantAttr {
constant NAME (line 54) | const NAME: &'static str = "field";
type VariantExt (line 57) | pub(crate) trait VariantExt {
method first_form_field_value (line 58) | fn first_form_field_value(&self) -> Result<FieldName>;
method form_field_values (line 59) | fn form_field_values(&self) -> Result<Vec<FieldName>>;
method first_form_field_value (line 63) | fn first_form_field_value(&self) -> Result<FieldName> {
method form_field_values (line 73) | fn form_field_values(&self) -> Result<Vec<FieldName>> {
method from_meta (line 88) | fn from_meta(meta: &MetaItem) -> Result<Self> {
method to_tokens (line 144) | fn to_tokens(&self, tokens: &mut TokenStream) {
method eq (line 150) | fn eq(&self, other: &Self) -> bool {
function member_to_ident (line 161) | fn member_to_ident(member: syn::Member) -> syn::Ident {
type RecordMemberAccesses (line 224) | struct RecordMemberAccesses {
method visit_expr_reference (line 230) | fn visit_expr_reference(&mut self, i: &'a syn::ExprReference) {
method visit_expr_field (line 236) | fn visit_expr_field(&mut self, i: &syn::ExprField) {
type ValidationMutator (line 248) | struct ValidationMutator<'a> {
function visit_token_stream (line 254) | fn visit_token_stream(&mut self, tt: TokenStream) -> TokenStream {
method visit_expr_call_mut (line 288) | fn visit_expr_call_mut(&mut self, call: &mut syn::ExprCall) {
method visit_macro_mut (line 300) | fn visit_macro_mut(&mut self, mac: &mut syn::Macro) {
method visit_ident_mut (line 305) | fn visit_ident_mut(&mut self, i: &mut syn::Ident) {
method visit_expr_mut (line 312) | fn visit_expr_mut(&mut self, i: &mut syn::Expr) {
function validators (line 346) | pub fn validators(field: Field<'_>) -> Result<impl Iterator<Item = syn::...
function default_expr (line 395) | fn default_expr(expr: &syn::Expr) -> TokenStream {
function default (line 407) | pub fn default(field: Field<'_>) -> Result<Option<TokenStream>> {
type Dup (line 457) | type Dup = (usize, Span, Span);
function first_duplicate (line 459) | pub fn first_duplicate<K: Spanned, V: PartialEq + Spanned>(
FILE: core/codegen/src/derive/from_form.rs
type WherePredicates (line 11) | type WherePredicates = syn::punctuated::Punctuated<syn::WherePredicate, ...
function fields_map (line 22) | fn fields_map<F>(fields: Fields<'_>, map_f: F) -> Result<TokenStream>
function generic_bounds_tokens (line 60) | fn generic_bounds_tokens(input: Input<'_>) -> Result<TokenStream> {
function generic_bounds (line 76) | fn generic_bounds(input: Input<'_>) -> Result<WherePredicates> {
function context_type (line 80) | fn context_type(input: Input<'_>) -> Result<(TokenStream, syn::Generics)> {
function derive_from_form (line 93) | pub fn derive_from_form(input: proc_macro::TokenStream) -> TokenStream {
FILE: core/codegen/src/derive/from_form_field.rs
function derive_from_form_field (line 7) | pub fn derive_from_form_field(input: proc_macro::TokenStream) -> TokenSt...
FILE: core/codegen/src/derive/from_param.rs
function derive_from_param (line 10) | pub fn derive_from_param(input: proc_macro::TokenStream) -> TokenStream {
FILE: core/codegen/src/derive/responder.rs
type ItemAttr (line 10) | struct ItemAttr {
type FieldAttr (line 16) | struct FieldAttr {
function derive_responder (line 20) | pub fn derive_responder(input: proc_macro::TokenStream) -> TokenStream {
FILE: core/codegen/src/derive/uri_display.rs
constant NO_EMPTY_FIELDS (line 9) | const NO_EMPTY_FIELDS: &str = "fieldless structs are not supported";
constant NO_NULLARY (line 10) | const NO_NULLARY: &str = "nullary items are not supported";
constant NO_EMPTY_ENUMS (line 11) | const NO_EMPTY_ENUMS: &str = "empty enums are not supported";
constant ONLY_ONE_UNNAMED (line 12) | const ONLY_ONE_UNNAMED: &str = "tuple structs or variants must have exac...
constant EXACTLY_ONE_FIELD (line 13) | const EXACTLY_ONE_FIELD: &str = "struct must have exactly one field";
constant Q_URI_DISPLAY (line 15) | const Q_URI_DISPLAY: StaticTokens = quote_static!(#_fmt::UriDisplay<#_fm...
constant Q_FORMATTER (line 16) | const Q_FORMATTER: StaticTokens = quote_static!(#_fmt::Formatter<#_fmt::...
constant P_URI_DISPLAY (line 18) | const P_URI_DISPLAY: StaticTokens = quote_static!(#_fmt::UriDisplay<#_fm...
constant P_FORMATTER (line 19) | const P_FORMATTER: StaticTokens = quote_static!(#_fmt::Formatter<#_fmt::...
function generic_bounds_mapper (line 21) | fn generic_bounds_mapper(bound: StaticTokens) -> MapperBuild {
function derive_uri_display_query (line 36) | pub fn derive_uri_display_query(input: proc_macro::TokenStream) -> Token...
function derive_uri_display_path (line 113) | pub fn derive_uri_display_path(input: proc_macro::TokenStream) -> TokenS...
function from_uri_param (line 153) | fn from_uri_param<P: fmt::Part>(input: proc_macro::TokenStream, ty: Toke...
FILE: core/codegen/src/exports.rs
type StaticPath (line 5) | pub struct StaticPath(pub Option<Span>, pub &'static str);
method respanned (line 23) | pub fn respanned(mut self, span: Span) -> Self {
type StaticTokens (line 8) | pub struct StaticTokens(pub fn() -> TokenStream);
method to_tokens (line 17) | fn to_tokens(&self, tokens: &mut TokenStream) {
method to_tokens (line 30) | fn to_tokens(&self, tokens: &mut TokenStream) {
function mixed (line 113) | pub fn mixed(span: Span) -> Span {
FILE: core/codegen/src/http_codegen.rs
type ContentType (line 8) | pub struct ContentType(pub http::ContentType);
type Status (line 11) | pub struct Status(pub http::Status);
type MediaType (line 14) | pub struct MediaType(pub http::MediaType);
type Method (line 17) | pub struct Method(pub http::Method);
type Optional (line 20) | pub struct Optional<T>(pub Option<T>);
type Origin (line 23) | pub struct Origin<'a>(pub &'a http::uri::Origin<'a>, pub Span);
type Absolute (line 26) | pub struct Absolute<'a>(pub &'a http::uri::Absolute<'a>, pub Span);
type Authority (line 29) | pub struct Authority<'a>(pub &'a http::uri::Authority<'a>, pub Span);
type Reference (line 32) | pub struct Reference<'a>(pub &'a http::uri::Reference<'a>, pub Span);
type Asterisk (line 35) | pub struct Asterisk(pub http::uri::Asterisk, pub Span);
method from_meta (line 38) | fn from_meta(meta: &MetaItem) -> Result<Self> {
method to_tokens (line 49) | fn to_tokens(&self, tokens: &mut TokenStream) {
method from_meta (line 56) | fn from_meta(meta: &MetaItem) -> Result<Self> {
method to_tokens (line 64) | fn to_tokens(&self, tokens: &mut TokenStream) {
method from_meta (line 72) | fn from_meta(meta: &MetaItem) -> Result<Self> {
method to_tokens (line 89) | fn to_tokens(&self, tokens: &mut TokenStream) {
method from_meta (line 101) | fn from_meta(meta: &MetaItem) -> Result<Self> {
method to_tokens (line 126) | fn to_tokens(&self, tokens: &mut TokenStream) {
method to_tokens (line 133) | fn to_tokens(&self, tokens: &mut TokenStream) {
method to_tokens (line 147) | fn to_tokens(&self, tokens: &mut TokenStream) {
method to_tokens (line 161) | fn to_tokens(&self, tokens: &mut TokenStream) {
method to_tokens (line 177) | fn to_tokens(&self, tokens: &mut TokenStream) {
method to_tokens (line 191) | fn to_tokens(&self, tokens: &mut TokenStream) {
method to_tokens (line 208) | fn to_tokens(&self, tokens: &mut TokenStream) {
FILE: core/codegen/src/lib.rs
function catch (line 362) | pub fn catch(args: TokenStream, input: TokenStream) -> TokenStream {
function suppress (line 389) | pub fn suppress(args: TokenStream, input: TokenStream) -> TokenStream {
function async_test (line 411) | pub fn async_test(args: TokenStream, input: TokenStream) -> TokenStream {
function main (line 453) | pub fn main(args: TokenStream, input: TokenStream) -> TokenStream {
function launch (line 512) | pub fn launch(args: TokenStream, input: TokenStream) -> TokenStream {
function derive_from_form_field (line 579) | pub fn derive_from_form_field(input: TokenStream) -> TokenStream {
function derive_from_form (line 780) | pub fn derive_from_form(input: TokenStream) -> TokenStream {
function derive_from_param (line 822) | pub fn derive_from_param(input: TokenStream) -> TokenStream {
function derive_responder (line 1015) | pub fn derive_responder(input: TokenStream) -> TokenStream {
function derive_uri_display_query (line 1109) | pub fn derive_uri_display_query(input: TokenStream) -> TokenStream {
function derive_uri_display_path (line 1135) | pub fn derive_uri_display_path(input: TokenStream) -> TokenStream {
function routes (line 1191) | pub fn routes(input: TokenStream) -> TokenStream {
function catchers (line 1249) | pub fn catchers(input: TokenStream) -> TokenStream {
function uri (line 1545) | pub fn uri(input: TokenStream) -> TokenStream {
function rocket_internal_uri (line 1552) | pub fn rocket_internal_uri(input: TokenStream) -> TokenStream {
function __typed_stream (line 1559) | pub fn __typed_stream(input: TokenStream) -> TokenStream {
function internal_guide_tests (line 1566) | pub fn internal_guide_tests(input: TokenStream) -> TokenStream {
function export (line 1573) | pub fn export(input: TokenStream) -> TokenStream {
function async_bound (line 1580) | pub fn async_bound(args: TokenStream, input: TokenStream) -> TokenStream {
FILE: core/codegen/src/name.rs
type Name (line 18) | pub struct Name {
method new (line 26) | pub fn new<S: Into<String>>(name: S, span: Span) -> Self {
method as_str (line 32) | pub fn as_str(&self) -> &str {
method as_uncased_str (line 37) | pub fn as_uncased_str(&self) -> &UncasedStr {
method span (line 41) | pub fn span(&self) -> Span {
method from_meta (line 47) | fn from_meta(meta: &devise::MetaItem) -> devise::Result<Self> {
method to_tokens (line 59) | fn to_tokens(&self, tokens: &mut TokenStream) {
method from (line 65) | fn from(ident: &Ident) -> Self {
method as_ref (line 71) | fn as_ref(&self) -> &str {
method hash (line 77) | fn hash<H: std::hash::Hasher>(&self, hasher: &mut H) {
type Target (line 83) | type Target = str;
method deref (line 85) | fn deref(&self) -> &Self::Target {
method eq (line 93) | fn eq(&self, other: &S) -> bool {
method fmt (line 99) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
FILE: core/codegen/src/proc_macro_ext.rs
type Diagnostics (line 7) | pub struct Diagnostics(Vec<Diagnostic>);
method new (line 10) | pub fn new() -> Self {
method push (line 14) | pub fn push(&mut self, diag: Diagnostic) {
method emit_head (line 18) | pub fn emit_head(self) -> Diagnostic {
method head_err_or (line 30) | pub fn head_err_or<T>(self, ok: T) -> devise::Result<T> {
method from (line 39) | fn from(diag: Diagnostic) -> Self {
method from (line 45) | fn from(diags: Vec<Diagnostic>) -> Self {
type StringLit (line 50) | pub struct StringLit(pub String, pub Literal);
method new (line 53) | pub fn new<S: Into<String>>(string: S, span: Span) -> Self {
method span (line 60) | pub fn span(&self) -> Span {
method subspan (line 67) | pub fn subspan<R: RangeBounds<usize>>(&self, range: R) -> Span {
method parse (line 73) | fn parse(input: syn::parse::ParseStream<'_>) -> syn::Result<Self> {
method from_meta (line 80) | fn from_meta(meta: &devise::MetaItem) -> devise::Result<Self> {
type Target (line 86) | type Target = str;
method deref (line 88) | fn deref(&self) -> &str {
FILE: core/codegen/src/syn_ext.rs
type IdentExt (line 12) | pub trait IdentExt {
method prepend (line 13) | fn prepend(&self, string: &str) -> syn::Ident;
method append (line 14) | fn append(&self, string: &str) -> syn::Ident;
method with_span (line 15) | fn with_span(self, span: Span) -> syn::Ident;
method rocketized (line 16) | fn rocketized(&self) -> syn::Ident;
method uniqueify_with (line 17) | fn uniqueify_with<F: FnMut(&mut dyn Hasher)>(&self, f: F) -> syn::Ident;
method prepend (line 66) | fn prepend(&self, string: &str) -> syn::Ident {
method append (line 70) | fn append(&self, string: &str) -> syn::Ident {
method with_span (line 74) | fn with_span(mut self, span: Span) -> syn::Ident {
method rocketized (line 79) | fn rocketized(&self) -> syn::Ident {
method uniqueify_with (line 91) | fn uniqueify_with<F: FnMut(&mut dyn Hasher)>(&self, mut f: F) -> syn::...
type ReturnTypeExt (line 20) | pub trait ReturnTypeExt {
method ty (line 21) | fn ty(&self) -> Option<&syn::Type>;
method ty (line 105) | fn ty(&self) -> Option<&syn::Type> {
type FnArgExt (line 24) | pub trait FnArgExt {
method typed (line 25) | fn typed(&self) -> Option<(&syn::Ident, &syn::Type)>;
method wild (line 26) | fn wild(&self) -> Option<&syn::PatWild>;
method typed (line 114) | fn typed(&self) -> Option<(&Ident, &syn::Type)> {
method wild (line 124) | fn wild(&self) -> Option<&syn::PatWild> {
type TypeExt (line 29) | pub trait TypeExt {
method unfold_with_ty_macros (line 30) | fn unfold_with_ty_macros(&self, names: &[&str], mapper: MacTyMapFn) ->...
method is_concrete (line 31) | fn is_concrete(&self, generic_ident: &[&Ident]) -> bool;
method unfold_with_ty_macros (line 146) | fn unfold_with_ty_macros(&self, names: &[&str], mapper: MacTyMapFn) ->...
method is_concrete (line 190) | fn is_concrete(&self, generics: &[&Ident]) -> bool {
type GenericsExt (line 34) | pub trait GenericsExt {
method type_idents (line 35) | fn type_idents(&self) -> Vec<&Ident>;
method type_idents (line 219) | fn type_idents(&self) -> Vec<&Ident> {
type Child (line 39) | pub struct Child<'a> {
type Target (line 45) | type Target = syn::Type;
method deref (line 47) | fn deref(&self) -> &Self::Target {
type Owned (line 53) | type Owned = Child<'static>;
method into_owned (line 55) | fn into_owned(self) -> Self::Owned {
type MacTyMapFn (line 63) | type MacTyMapFn = fn(&TokenStream) -> Option<syn::Type>;
function macro_inner_ty (line 135) | fn macro_inner_ty(t: &syn::TypeMacro, names: &[&str], m: MacTyMapFn) -> ...
function test_type_unfold_is_generic (line 227) | fn test_type_unfold_is_generic() {
FILE: core/codegen/tests/async-entry.rs
function rocket (line 6) | async fn rocket() -> rocket::Rocket<rocket::Build> {
function use_it (line 11) | async fn use_it() {
function main2 (line 19) | async fn main2() -> _ {
function use_it (line 23) | async fn use_it() {
function main2 (line 30) | async fn main2() -> _ { rocket::build() }
function use_it (line 32) | async fn use_it() {
function rocket (line 40) | fn rocket() -> _ {
function use_it (line 44) | fn use_it() {
function rocket (line 51) | fn rocket() -> _ { rocket::build() }
function use_it (line 53) | fn use_it() {
function main (line 61) | async fn main() {
function main (line 69) | async fn main() { }
function main (line 75) | async fn main() -> Result<(), rocket::Error> {
function main (line 84) | async fn main() -> Result<(), String> {
function main (line 91) | async fn main() -> Result<(), String> {
FILE: core/codegen/tests/async-routes.rs
function noop (line 7) | async fn noop() { }
function hello (line 10) | async fn hello(_origin: &Origin<'_>) -> &'static str {
function repeated_query (line 16) | async fn repeated_query(sort: Vec<&str>) -> &str {
function not_found (line 22) | async fn not_found(req: &Request<'_>) -> String {
FILE: core/codegen/tests/catcher.rs
function not_found_0 (line 12) | fn not_found_0() -> &'static str { "404-0" }
function not_found_1 (line 13) | fn not_found_1(_: &Request<'_>) -> &'static str { "404-1" }
function not_found_2 (line 14) | fn not_found_2(_: Status, _: &Request<'_>) -> &'static str { "404-2" }
function all (line 15) | fn all(_: Status, r: &Request<'_>) -> String { r.uri().to_string() }
function test_simple_catchers (line 18) | fn test_simple_catchers() {
function forward (line 39) | fn forward(code: u16) -> Status { Status::new(code) }
function forward_400 (line 40) | fn forward_400(status: Status, _: &Request<'_>) -> String { status.code....
function forward_404 (line 41) | fn forward_404(status: Status, _: &Request<'_>) -> String { status.code....
function forward_444 (line 42) | fn forward_444(status: Status, _: &Request<'_>) -> String { status.code....
function forward_500 (line 43) | fn forward_500(status: Status, _: &Request<'_>) -> String { status.code....
function test_status_param (line 46) | fn test_status_param() {
FILE: core/codegen/tests/expansion.rs
function easy (line 6) | fn easy(id: i32) -> String {
function test_reexpansion (line 35) | fn test_reexpansion() {
function test_index (line 61) | fn test_index() {
FILE: core/codegen/tests/from_form.rs
function strict (line 12) | fn strict<'f, T: FromForm<'f>>(string: &'f str) -> Result<T, Errors<'f>> {
function lenient (line 16) | fn lenient<'f, T: FromForm<'f>>(string: &'f str) -> Result<T, Errors<'f>> {
function strict_encoded (line 20) | fn strict_encoded<T: 'static>(string: &str) -> Result<T, Errors<'static>>
type TodoTask (line 27) | struct TodoTask {
function simple (line 33) | fn simple() {
type FormOption (line 60) | enum FormOption {
type FormInput (line 65) | struct FormInput<'r> {
type DefaultInput (line 75) | struct DefaultInput<'r> {
type ManualMethod (line 80) | struct ManualMethod<'r> {
type UnpresentCheckbox (line 86) | struct UnpresentCheckbox {
type UnpresentCheckboxTwo (line 91) | struct UnpresentCheckboxTwo<'r> {
type FieldNamedV (line 97) | struct FieldNamedV<'r> {
function base_conditions (line 102) | fn base_conditions() {
function lenient_parsing (line 165) | fn lenient_parsing() {
function field_renaming (line 198) | fn field_renaming() {
function generics (line 293) | fn generics() {
function form_errors (line 338) | fn form_errors() {
function form_validate_error_return_correct_field_name (line 413) | fn form_validate_error_return_correct_field_name() {
function form_validate_contains_all_errors (line 433) | fn form_validate_contains_all_errors() {
function raw_ident_form (line 458) | fn raw_ident_form() {
function test_multi (line 469) | fn test_multi() {
type Dog (line 521) | struct Dog {
type Cat (line 527) | struct Cat<'r> {
type Pet (line 533) | struct Pet<'r, T> {
type Person (line 540) | struct Person<'r> {
function test_nested_multi (line 547) | fn test_nested_multi() {
function test_multipart (line 627) | fn test_multipart() {
function test_default_removed (line 676) | fn test_default_removed() {
function test_defaults (line 725) | fn test_defaults() {
function test_lazy_default (line 891) | fn test_lazy_default() {
type Token (line 935) | struct Token<'r>(&'r str);
type TokenOwned (line 939) | struct TokenOwned(String);
function wrapper_works (line 942) | fn wrapper_works() {
type JsonToken (line 966) | struct JsonToken<T>(Json<T>);
function json_wrapper_works (line 969) | fn json_wrapper_works() {
type Q (line 989) | struct Q<T>(T);
type JsonTokenBad (line 993) | pub struct JsonTokenBad<T>(Q<T>);
function range (line 996) | fn range() {
FILE: core/codegen/tests/from_form_field.rs
function parse (line 3) | fn parse<'v, T: FromForm<'v>>(value: &'v str) -> Result<T, Errors<'v>> {
function from_form_value_simple (line 32) | fn from_form_value_simple() {
function from_form_value_weirder (line 42) | fn from_form_value_weirder() {
function from_form_value_no_parse (line 52) | fn from_form_value_no_parse() {
function from_form_value_renames (line 61) | fn from_form_value_renames() {
function from_form_value_raw (line 77) | fn from_form_value_raw() {
function form_value_errors (line 91) | fn form_value_errors() {
FILE: core/codegen/tests/from_param.rs
type Test (line 5) | enum Test {
function derive_from_param (line 12) | fn derive_from_param() {
FILE: core/codegen/tests/responder.rs
type Foo (line 8) | pub enum Foo<'r> {
function responder_foo (line 25) | async fn responder_foo() {
type Bar (line 65) | pub struct Bar<'r> {
function responder_bar (line 74) | async fn responder_bar() {
type Baz (line 94) | pub struct Baz {
function responder_baz (line 99) | async fn responder_baz() {
type MyResult (line 116) | enum MyResult<'a, T, E, H1, H2> {
function generic_responder (line 125) | async fn generic_responder() {
FILE: core/codegen/tests/route-data.rs
type Inner (line 12) | struct Inner<'r> {
type Simple (line 16) | struct Simple<'r>(&'r str);
type Error (line 20) | type Error = std::io::Error;
function from_data (line 22) | async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> data::Outcom...
function form (line 28) | fn form<'r>(form: Form<Inner<'r>>) -> &'r str { form.into_inner().field }
function simple (line 31) | fn simple<'r>(simple: Simple<'r>) -> &'r str { simple.0 }
function test_data (line 34) | fn test_data() {
FILE: core/codegen/tests/route-format.rs
function json (line 9) | fn json() -> &'static str { "json" }
function xml (line 12) | fn xml() -> &'static str { "xml" }
function json_long (line 16) | fn json_long() -> &'static str { "json_long" }
function msgpack_long (line 19) | fn msgpack_long() -> &'static str { "msgpack_long" }
function msgpack (line 23) | fn msgpack() -> &'static str { "msgpack" }
function plain (line 26) | fn plain() -> &'static str { "plain" }
function binary (line 29) | fn binary() -> &'static str { "binary" }
function other (line 32) | fn other() -> &'static str { "other" }
function test_formats (line 35) | fn test_formats() {
function get_foo (line 71) | fn get_foo() -> &'static str { "get_foo" }
function post_foo (line 75) | fn post_foo() -> &'static str { "post_foo" }
function get_bar_baz (line 79) | fn get_bar_baz() -> &'static str { "get_bar_baz" }
function put_bar_baz (line 83) | fn put_bar_baz() -> &'static str { "put_bar_baz" }
function test_custom_formats (line 86) | fn test_custom_formats() {
FILE: core/codegen/tests/route-ranking.rs
function get0 (line 8) | fn get0(_number: u8) -> &'static str { "0" }
function get1 (line 11) | fn get1(_number: u16) -> &'static str { "1" }
function get2 (line 14) | fn get2(_number: u32) -> &'static str { "2" }
function get3 (line 17) | fn get3(_number: u64) -> &'static str { "3" }
function test_ranking (line 20) | fn test_ranking() {
function get0b (line 40) | fn get0b(_n: u8) { }
function test_rank_collision (line 43) | fn test_rank_collision() {
FILE: core/codegen/tests/route-raw.rs
function get (line 8) | fn get(r#enum: String, r#type: i32) -> String {
function swap (line 13) | fn swap(r#raw: String, bare: String) -> String {
function catch (line 18) | fn catch(r#raw: &rocket::Request<'_>) -> String {
function test_raw_ident (line 23) | fn test_raw_ident() {
FILE: core/codegen/tests/route-uniqueness.rs
function index (line 4) | fn index() { }
function index (line 11) | pub fn index() { }
function test_uri_reachability (line 37) | fn test_uri_reachability() {
function test_uri_calls (line 61) | fn test_uri_calls() {
FILE: core/codegen/tests/route.rs
type Inner (line 19) | struct Inner<'r> {
type Simple (line 23) | struct Simple(String);
type Error (line 27) | type Error = std::io::Error;
method from_data (line 29) | async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> data::Outc...
function post1 (line 40) | fn post1(
function post2 (line 63) | fn post2(
function test_unused_params (line 81) | fn test_unused_params(_unused_param: String, _unused_query: String, _unu...
function test_full_route (line 85) | fn test_full_route() {
function world (line 137) | pub fn world() -> &'static str {
function hello (line 143) | pub fn hello() -> &'static str {
function _rocket (line 149) | fn _rocket() -> rocket::Rocket<rocket::Build> {
type Filtered (line 157) | struct Filtered<'r> {
function filtered_raw_query (line 165) | fn filtered_raw_query(bird: usize, color: &str, rest: Contextual<'_, Fil...
function test_filtered_raw_query (line 174) | fn test_filtered_raw_query() {
type Dog (line 229) | struct Dog<'r> {
type Q (line 235) | struct Q<'r> {
function query_collection (line 240) | fn query_collection(color: Vec<&str>, q: Q<'_>) -> String {
function query_collection_2 (line 245) | fn query_collection_2(color: Vec<&str>, dog: Dog<'_>) -> String {
function test_query_collection (line 250) | fn test_query_collection() {
type PathString (line 305) | struct PathString(String);
type Error (line 308) | type Error = std::convert::Infallible;
method from_segments (line 310) | fn from_segments(segments: Segments<'_, Path>) -> Result<Self, Self::E...
function segments (line 317) | fn segments(path: PathString) -> String {
function segments_empty (line 322) | fn segments_empty(path: PathString) -> String {
function test_inclusive_segments (line 327) | fn test_inclusive_segments() {
FILE: core/codegen/tests/segment-ignore.rs
function ig_1 (line 4) | fn ig_1() -> &'static str { "1" }
function just_static (line 6) | fn just_static() -> &'static str { "static" }
function ig_2 (line 8) | fn ig_2() -> &'static str { "2" }
function ig_1_static (line 10) | fn ig_1_static() -> &'static str { "static_1" }
function ig_3 (line 12) | fn ig_3() -> &'static str { "3" }
function ig_1_static_static (line 14) | fn ig_1_static_static() -> &'static str { "static_1_static" }
function wrapped (line 16) | fn wrapped(a: String, b: String) -> String { a + &b }
function test_ignored_segments (line 19) | fn test_ignored_segments() {
FILE: core/codegen/tests/typed-uris.rs
type User (line 25) | struct User<'a> {
type Target (line 31) | type Target = User<'a>;
function from_uri_param (line 32) | fn from_uri_param((name, nickname): (&'a str, &'b str)) -> User<'a> {
type Second (line 41) | struct Second {
function index (line 46) | fn index() { }
function simple (line 49) | fn simple(id: i32) { }
function simple2 (line 52) | fn simple2(id: i32, name: String) { }
function simple2_flipped (line 55) | fn simple2_flipped(name: String, id: i32) { }
function simple3 (line 58) | fn simple3(id: i32) { }
function simple4 (line 61) | fn simple4(id: i32, name: String) { }
function simple4_flipped (line 64) | fn simple4_flipped(name: String, id: i32) { }
function unused_param (line 67) | fn unused_param(used: i32, _unused: i32) { }
function guard_1 (line 70) | fn guard_1(cookies: &CookieJar<'_>, id: i32) { }
function guard_2 (line 73) | fn guard_2(name: String, cookies: &CookieJar<'_>, id: i32) { }
function guard_3 (line 76) | fn guard_3(id: i32, name: String, cookies: &CookieJar<'_>) { }
function no_uri_display_okay (line 79) | fn no_uri_display_okay(id: i32, form: Form<Second>) { }
function complex (line 82) | fn complex<'r>(
function segments (line 92) | fn segments(path: PathBuf) { }
function param_and_segments (line 95) | fn param_and_segments(path: PathBuf, id: usize) { }
function guarded_segments (line 98) | fn guarded_segments(cookies: &CookieJar<'_>, path: PathBuf, id: usize) { }
function check_simple_unnamed (line 101) | fn check_simple_unnamed() {
function check_simple_named (line 141) | fn check_simple_named() {
function check_route_prefix_suffix (line 186) | fn check_route_prefix_suffix() {
function check_guards_ignored (line 307) | fn check_guards_ignored() {
function check_with_segments (line 325) | fn check_with_segments() {
function check_complex (line 351) | fn check_complex() {
function check_location_promotion (line 394) | fn check_location_promotion() {
function check_scoped (line 433) | fn check_scoped() {
function simple (line 443) | fn simple(id: i32) { }
function check_simple_scoped (line 446) | fn check_simple_scoped() {
function simple (line 457) | fn simple(id: i32) { }
function check_deep_scoped (line 460) | fn check_deep_scoped() {
type Third (line 470) | struct Third<'r> {
function optionals (line 476) | fn optionals(
function test_optional_uri_parameters (line 484) | fn test_optional_uri_parameters() {
function test_simple_ignored (line 554) | fn test_simple_ignored() {
function test_maps (line 590) | fn test_maps() {
function test_json (line 624) | fn test_json() {
function test_route_uri_normalization_with_prefix (line 659) | fn test_route_uri_normalization_with_prefix() {
function test_vec_in_query (line 678) | fn test_vec_in_query() {
function test_either (line 714) | fn test_either() {
FILE: core/codegen/tests/ui-fail.rs
function ui (line 3) | fn ui() {
FILE: core/codegen/tests/ui-fail/async-entry.rs
function foo (line 5) | fn foo() { }
function foo (line 11) | async fn foo() { }
function main (line 17) | fn main() {
function main (line 24) | async fn main() {
function rocket (line 33) | async fn rocket() -> String {
function rocket (line 42) | async fn rocket() -> _ {
function main (line 50) | fn main() -> rocket::Rocket<rocket::Build> {
function rocket (line 57) | async fn rocket() {
function rocket (line 65) | fn rocket() {
function rocket (line 72) | fn rocket() -> _ {
function main (line 80) | fn main() -> &'static str {
function main (line 88) | async fn main() -> _ {
function main (line 94) | async fn main() -> rocket::Rocket<rocket::Build> {
FILE: core/codegen/tests/ui-fail/bad-ignored-segments.rs
function i0 (line 4) | fn i0() {}
function i1 (line 7) | fn i1() {}
function i2 (line 10) | fn i2() {}
function main (line 12) | fn main() { }
FILE: core/codegen/tests/ui-fail/catch.rs
type Catcher (line 6) | struct Catcher(String);
constant CATCH (line 9) | const CATCH: &str = "Catcher";
function e1 (line 12) | fn e1(_request: &Request) { }
function e2 (line 15) | fn e2(_request: &Request) { }
function e3 (line 18) | fn e3(_request: &Request) { }
function e4 (line 21) | fn e4(_request: &Request) { }
function e5 (line 24) | fn e5(_request: &Request) { }
function e5 (line 27) | fn e5(_request: &Request) { }
function f3 (line 30) | fn f3(_request: &Request, _other: bool) { }
function main (line 32) | fn main() { }
FILE: core/codegen/tests/ui-fail/catch_type_errors.rs
function f1 (line 6) | fn f1(_request: &Request) -> usize {
function f2 (line 11) | fn f2(_request: &Request) -> bool {
function f3 (line 16) | fn f3(_request: bool) -> usize {
function f4 (line 21) | fn f4() -> usize {
function main (line 25) | fn main() { }
FILE: core/codegen/tests/ui-fail/catchers.rs
function main (line 3) | fn main() {
FILE: core/codegen/tests/ui-fail/from_form.rs
type Thing (line 4) | enum Thing { }
type Foo1 (line 7) | struct Foo1;
type Foo2 (line 10) | struct Foo2 { }
type Foo3 (line 13) | struct Foo3(usize);
type Foo4 (line 16) | struct Foo4(usize, usize, usize);
type NextTodoTask (line 19) | struct NextTodoTask<'f, 'a> {
type BadName1 (line 27) | struct BadName1 {
type Demo2 (line 33) | struct Demo2 {
type MyForm9 (line 40) | struct MyForm9 {
type MyForm10 (line 48) | struct MyForm10 {
type MyForm (line 55) | struct MyForm {
type MyForm1 (line 61) | struct MyForm1 {
type MyForm2 (line 67) | struct MyForm2 {
type MyForm3 (line 73) | struct MyForm3 {
type MyForm4 (line 79) | struct MyForm4 {
type MyForm5 (line 85) | struct MyForm5 {
type MyForm6 (line 92) | struct MyForm6 {
type MyForm7 (line 98) | struct MyForm7 {
type MyForm8 (line 104) | struct MyForm8 {
type MyForm11 (line 110) | struct MyForm11 {
type MyForm12 (line 116) | struct MyForm12 {
type MyForm13 (line 122) | struct MyForm13 {
type MyForm14 (line 128) | struct MyForm14 {
type BadName2 (line 134) | struct BadName2 {
type BadName3 (line 140) | struct BadName3 {
type Validate0 (line 146) | struct Validate0 {
type Validate1 (line 152) | struct Validate1 {
type Validate2 (line 158) | struct Validate2 {
type Validate3 (line 164) | struct Validate3 {
type Default0 (line 170) | struct Default0 {
type Default1 (line 176) | struct Default1 {
type Default2 (line 182) | struct Default2 {
type Default3 (line 189) | struct Default3 {
type Default4 (line 195) | struct Default4 {
type Default5 (line 202) | struct Default5 {
type Default6 (line 208) | struct Default6 {
type Another (line 214) | struct Another<T> {
type AnotherOne (line 220) | struct AnotherOne<T> { // NO ERROR
function main (line 225) | fn main() { }
FILE: core/codegen/tests/ui-fail/from_form_field.rs
type Foo1 (line 4) | struct Foo1;
type Foo2 (line 7) | struct Foo2(usize);
type Foo3 (line 10) | struct Foo3 {
type Foo4 (line 15) | enum Foo4 {
type Foo5 (line 20) | enum Foo5 { }
type Foo6 (line 23) | enum Foo6<T> {
type Bar1 (line 28) | enum Bar1 {
type Bar2 (line 34) | enum Bar2 {
type Dup1 (line 40) | enum Dup1 {
type Dup2 (line 47) | enum Dup2 {
type Dup3 (line 55) | enum Dup3 {
type Dup4 (line 62) | enum Dup4 {
type Dup5 (line 71) | enum Dup5 {
type Dup6 (line 79) | enum Dup6 {
type Renamed0 (line 86) | struct Renamed0 {
type Renamed1 (line 93) | struct Renamed1 {
type Renamed2 (line 101) | struct Renamed2 {
type Renamed3 (line 108) | struct Renamed3 {
function main (line 114) | fn main() { }
FILE: core/codegen/tests/ui-fail/from_form_type_errors.rs
type Unknown (line 3) | struct Unknown;
type BadType3 (line 6) | struct BadType3 {
type Foo (line 10) | struct Foo<T>(T);
type Other (line 13) | struct Other {
function main (line 17) | fn main() { }
FILE: core/codegen/tests/ui-fail/from_param.rs
type Foo1 (line 4) | struct Foo1 {
type Foo2 (line 9) | struct Foo2 {}
type Foo3 (line 12) | enum Foo3 {
type Foo4 (line 18) | struct Foo4(usize);
function main (line 20) | fn main() {}
FILE: core/codegen/tests/ui-fail/responder-types.rs
type Thing1 (line 4) | struct Thing1 {
type Thing2 (line 9) | struct Thing2 {
type Thing3 (line 15) | struct Thing3 {
type Thing4 (line 21) | struct Thing4 {
function foo (line 28) | fn foo() -> usize { 0 }
function main (line 30) | fn main() { }
FILE: core/codegen/tests/ui-fail/responder.rs
type Thing1 (line 4) | struct Thing1;
type Thing2 (line 7) | struct Thing2();
type Bar (line 10) | enum Bar { }
type Foo (line 13) | enum Foo { Bark, }
type Thing4 (line 16) | struct Thing4<'a, 'b>(&'a str, &'b str);
type Thing5 (line 19) | struct Thing5<T>(T);
type Thing6 (line 22) | struct Thing6<T, E>(T, E);
type Thing7 (line 26) | struct Thing7(());
type Thing8 (line 30) | struct Thing8(());
type Thing9 (line 34) | struct Thing9(());
type Thing10 (line 38) | struct Thing10(());
type Thing11 (line 42) | struct Thing11(());
type Thing12 (line 46) | struct Thing12(());
type Thing13 (line 50) | struct Thing13(());
type Error (line 53) | enum Error<'r, T> {
type Error2 (line 63) | enum Error2<'r, T> {
function main (line 67) | fn main() {}
FILE: core/codegen/tests/ui-fail/route-attribute-general-syntax.rs
function a0 (line 5) | fn a0() {}
type S (line 9) | struct S;
type A (line 12) | enum A { }
type Foo (line 15) | trait Foo { }
function b0 (line 22) | fn b0() {}
function b1 (line 25) | fn b1() {}
function b2 (line 28) | fn b2(foo: usize) {}
function b3 (line 31) | fn b3() {}
function b4 (line 34) | fn b4() {}
function c1 (line 39) | fn c1(_: usize) {}
function d0 (line 44) | fn d0() {}
function d1 (line 47) | fn d1() {}
function d2 (line 50) | fn d2() {}
function d3 (line 53) | fn d3() {}
function e0 (line 58) | fn e0() {}
function e1 (line 61) | fn e1() {}
function e2 (line 64) | fn e2() {}
function e3 (line 67) | fn e3() {}
function e4 (line 70) | fn e4() {}
function e5 (line 73) | fn e5() {}
function e6 (line 76) | fn e6() {}
function e7 (line 79) | fn e7() {}
function e8 (line 82) | fn e8() {}
function e9 (line 85) | fn e9() {}
function e10 (line 88) | fn e10() {}
function e12 (line 91) | fn e12() {}
function f0 (line 96) | fn f0() {}
function f1 (line 99) | fn f1() {}
function f2 (line 102) | fn f2() {}
function f3 (line 105) | fn f3() {}
function f4 (line 108) | fn f4() {}
function main (line 110) | fn main() {}
FILE: core/codegen/tests/ui-fail/route-path-bad-syntax.rs
function f0 (line 6) | fn f0() {}
function f1 (line 9) | fn f1() {}
function f2 (line 12) | fn f2() {}
function f3 (line 15) | fn f3() {}
function f4 (line 18) | fn f4() {}
function f5 (line 21) | fn f5() {}
function f6 (line 24) | fn f6() {}
function g1 (line 29) | fn g1() {}
function g2 (line 32) | fn g2() {}
function g3 (line 35) | fn g3() {}
function g4 (line 38) | fn g4() {}
function h0 (line 43) | fn h0(_name: usize) {}
function h1 (line 46) | fn h1() {}
function h2 (line 49) | fn h2() {}
function h3 (line 52) | fn h3() {}
function h4 (line 55) | fn h4() {}
function i0 (line 61) | fn i0() {}
function i1 (line 64) | fn i1() {}
function i2 (line 67) | fn i2() {}
function i3 (line 70) | fn i3() {}
function j0 (line 75) | fn j0() {}
function j1 (line 78) | fn j1() {}
function j2 (line 81) | fn j2() {}
function j3 (line 84) | fn j3() {}
function k0 (line 89) | fn k0(_: usize) {}
function m0 (line 94) | fn m0() {}
function m1 (line 97) | fn m1() {}
function m2 (line 100) | fn m2() {}
function m3 (line 103) | fn m3() {}
function n1 (line 108) | fn n1() {}
function n2 (line 111) | fn n2() {}
function n3 (line 114) | fn n3() {}
function main (line 116) | fn main() { }
FILE: core/codegen/tests/ui-fail/route-type-errors.rs
type Q (line 3) | struct Q;
function f0 (line 6) | fn f0(_foo: Q) {}
function f1 (line 9) | fn f1(_foo: Q) {}
function f2 (line 12) | fn f2(_foo: Q) {}
function f3 (line 15) | fn f3(_foo: Q) {}
function f4 (line 18) | fn f4(_foo: Q) {}
function f5 (line 21) | fn f5(_a: Q, _foo: Q) {}
function f6 (line 24) | fn f6(_a: Q, _foo: Q, _good: usize, _bar: Q) {}
function main (line 26) | fn main() { }
FILE: core/codegen/tests/ui-fail/route-warnings.rs
function f0 (line 8) | fn f0() {}
function f1 (line 11) | fn f1() {}
function f2 (line 14) | fn f2() {}
function f3 (line 18) | fn f3() {}
function g0 (line 23) | fn g0(_foo: rocket::Data<'_>) {}
function g1 (line 26) | fn g1(_foo: rocket::Data<'_>) {}
function g2 (line 30) | fn g2(_foo: rocket::Data<'_>) {}
function main (line 32) | fn main() {
FILE: core/codegen/tests/ui-fail/routes.rs
function main (line 3) | fn main() {
FILE: core/codegen/tests/ui-fail/typed-uri-bad-type.rs
type S (line 7) | struct S;
type Error (line 10) | type Error = ();
method from_param (line 11) | fn from_param(param: &'a str) -> Result<Self, Self::Error> { Ok(S) }
method default (line 30) | fn default() -> Option<Self> { None }
method from_value (line 32) | fn from_value(_: ValueField<'v>) -> Result<Self, Errors<'v>> { Ok(S) }
method from_data (line 34) | async fn from_data(_: DataField<'v, '_>) -> Result<Self, Errors<'v>> {...
function simple (line 15) | fn simple(id: usize) { }
function not_uri_display (line 18) | fn not_uri_display(id: i32, name: S) { }
function not_uri_display_but_unused (line 21) | fn not_uri_display_but_unused(id: i32, name: S) { }
function optionals (line 24) | fn optionals(id: Option<i32>, name: Result<String, &str>) { }
function simple_q (line 38) | fn simple_q(id: isize) { }
function other_q (line 41) | fn other_q(id: usize, rest: S) { }
function optionals_q (line 44) | fn optionals_q(id: Option<i32>, name: Result<String, Errors<'_>>) { }
function main (line 46) | fn main() {
FILE: core/codegen/tests/ui-fail/typed-uris-bad-params.rs
function has_one (line 8) | fn has_one(id: i32) { }
function has_one_guarded (line 11) | fn has_one_guarded(cookies: &CookieJar<'_>, id: i32) { }
function has_two (line 14) | fn has_two(cookies: &CookieJar<'_>, id: i32, name: String) { }
function optionals (line 17) | fn optionals(id: Option<i32>, name: Result<String, &str>) { }
function ignored (line 20) | fn ignored() { }
function main (line 22) | fn main() {
FILE: core/codegen/tests/ui-fail/typed-uris-invalid-syntax.rs
function index (line 4) | fn index() { }
function simple (line 7) | fn simple(_id: i32, _name: String) -> &'static str { "" }
function main (line 9) | fn main() {
FILE: core/codegen/tests/ui-fail/uri_display.rs
type Foo1 (line 4) | struct Foo1;
type Foo2 (line 7) | struct Foo2();
type Foo3 (line 10) | enum Foo3 { }
type Foo4 (line 13) | enum Foo4 {
type Foo5 (line 18) | struct Foo5(String, String);
type Foo6 (line 21) | struct Foo6 {
type Foo7 (line 27) | struct Foo7(String, usize);
type Foo8 (line 30) | struct Foo8;
type Foo9 (line 33) | enum Foo9 { }
type Foo10 (line 36) | struct Foo10 {
function main (line 40) | fn main() { }
FILE: core/codegen/tests/ui-fail/uri_display_type_errors.rs
type BadType (line 3) | struct BadType;
type Bar1 (line 6) | struct Bar1(BadType);
type Bar2 (line 9) | struct Bar2 {
type Bar3 (line 14) | struct Bar3 {
type Bar4 (line 20) | enum Bar4 {
type Bar5 (line 25) | enum Bar5 {
type Bar6 (line 32) | enum Bar6 {
type Baz (line 40) | struct Baz(BadType);
function main (line 42) | fn main() { }
FILE: core/codegen/tests/uri_display.rs
type Foo (line 40) | enum Foo<'r> {
function uri_display_foo (line 53) | fn uri_display_foo() {
type Bar (line 74) | struct Bar<'a> {
function uri_display_bar (line 80) | fn uri_display_bar() {
type Baz (line 95) | struct Baz<'a> {
function uri_display_baz (line 102) | fn uri_display_baz() {
type Bam (line 121) | struct Bam<'a> {
function uri_display_bam (line 128) | fn uri_display_bam() {
function uri_display_c_like (line 143) | fn uri_display_c_like() {
type FooP (line 199) | struct FooP(&'static str);
type BarP (line 202) | struct BarP<'a>(&'a str);
type BazP (line 205) | struct BazP<'a, T>(&'a T);
type BamP (line 208) | struct BamP<T>(T);
type BopP (line 211) | struct BopP(FooP);
function uri_display_path (line 214) | fn uri_display_path() {
function uri_display_serde (line 226) | fn uri_display_serde() {
FILE: core/http/src/ext.rs
type IntoOwned (line 9) | pub trait IntoOwned {
method into_owned (line 14) | fn into_owned(self) -> Self::Owned;
type Owned (line 18) | type Owned = Option<T::Owned>;
method into_owned (line 21) | fn into_owned(self) -> Self::Owned {
type Owned (line 27) | type Owned = Vec<T::Owned>;
method into_owned (line 30) | fn into_owned(self) -> Self::Owned {
type Owned (line 40) | type Owned = InitCell<T::Owned>;
method into_owned (line 43) | fn into_owned(self) -> Self::Owned {
type Owned (line 49) | type Owned = (A::Owned, B::Owned);
method into_owned (line 52) | fn into_owned(self) -> Self::Owned {
type Owned (line 58) | type Owned = Cow<'static, B>;
method into_owned (line 61) | fn into_owned(self) -> <Self as IntoOwned>::Owned {
type Normalize (line 87) | pub trait Normalize {
method normalized_str (line 88) | fn normalized_str(&self) -> Cow<'_, str>;
method normalized_str (line 93) | fn normalized_str(&self) -> Cow<'_, str> {
method normalized_str (line 98) | fn normalized_str(&self) -> Cow<'_, str> {
FILE: core/http/src/header/accept.rs
type Accept (line 53) | pub struct Accept(pub(crate) Cow<'static, [QMediaType]>);
method new (line 102) | pub fn new<T: IntoIterator<Item = M>, M: Into<QMediaType>>(items: T) -...
method add (line 127) | pub fn add<M: Into<QMediaType>>(&mut self, media_type: M) {
method preferred (line 151) | pub fn preferred(&self) -> &QMediaType {
method first (line 194) | pub fn first(&self) -> Option<&QMediaType> {
method iter (line 221) | pub fn iter(&self) -> impl Iterator<Item=&'_ QMediaType> + '_ {
method media_types (line 247) | pub fn media_types(&self) -> impl Iterator<Item=&'_ MediaType> + '_ {
method from (line 256) | fn from(items: T) -> Accept {
method fmt (line 268) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type QMediaType (line 57) | pub struct QMediaType(pub MediaType, pub Option<f32>);
method weight (line 313) | pub fn weight(&self) -> Option<f32> {
method weight_or (line 332) | pub fn weight_or(&self, default: f32) -> f32 {
method media_type (line 348) | pub fn media_type(&self) -> &MediaType {
method from (line 365) | fn from(media_type: MediaType) -> QMediaType {
method eq (line 262) | fn eq(&self, other: &Accept) -> bool {
type Err (line 283) | type Err = String;
method from_str (line 286) | fn from_str(raw: &str) -> Result<Accept, String> {
function from (line 295) | fn from(val: Accept) -> Self {
type Item (line 354) | type Item = Self;
type IntoIter (line 356) | type IntoIter = std::iter::Once<Self>;
method into_iter (line 358) | fn into_iter(self) -> Self::IntoIter {
type Target (line 371) | type Target = MediaType;
method deref (line 374) | fn deref(&self) -> &MediaType {
function assert_preference (line 384) | fn assert_preference(string: &str, expect: &str) {
function test_preferred (line 395) | fn test_preferred() {
FILE: core/http/src/header/content_type.rs
type ContentType (line 43) | pub struct ContentType(pub MediaType);
method new (line 229) | pub fn new<T, S>(top: T, sub: S) -> ContentType
method with_params (line 264) | pub fn with_params<K, V, P>(self, parameters: P) -> ContentType
method media_type (line 284) | pub fn media_type(&self) -> &MediaType {
method from (line 359) | fn from(media_type: MediaType) -> Self {
method fmt (line 377) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method default (line 296) | fn default() -> ContentType {
type Target (line 302) | type Target = MediaType;
method deref (line 305) | fn deref(&self) -> &MediaType {
type Err (line 311) | type Err = String;
method from_str (line 353) | fn from_str(raw: &str) -> Result<ContentType, String> {
function from (line 386) | fn from(content_type: ContentType) -> Self {
FILE: core/http/src/header/header.rs
type Header (line 10) | pub struct Header<'h> {
function new (line 48) | pub fn new<'a: 'h, 'b: 'h, N, V>(name: N, value: V) -> Header<'h>
function is_valid_name (line 91) | pub const fn is_valid_name(name: &str) -> bool {
function is_valid_value (line 155) | pub const fn is_valid_value(val: &str, allow_empty: bool) -> bool {
function name (line 206) | pub fn name(&self) -> &UncasedStr {
function value (line 224) | pub fn value(&self) -> &str {
function fmt (line 231) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type HeaderMap (line 245) | pub struct HeaderMap<'h> {
function new (line 261) | pub fn new() -> HeaderMap<'h> {
function contains (line 280) | pub fn contains<N: AsRef<str>>(&self, name: N) -> bool {
function len (line 305) | pub fn len(&self) -> usize {
function is_empty (line 322) | pub fn is_empty(&self) -> bool {
function get (line 347) | pub fn get(&self, name: &str) -> impl Iterator<Item=&str> {
function get_one (line 388) | pub fn get_one<'a>(&'a self, name: &str) -> Option<&'a str> {
function replace (line 447) | pub fn replace<'p: 'h, H: Into<Header<'p>>>(&mut self, header: H) -> bool {
function replace_raw (line 471) | pub fn replace_raw<'a: 'h, 'b: 'h, N, V>(&mut self, name: N, value: V) -...
function replace_all (line 499) | pub fn replace_all<'n, 'v: 'h, H>(&mut self, name: H, values: Vec<Cow<'v...
function add (line 521) | pub fn add<'p: 'h, H: Into<Header<'p>>>(&mut self, header: H) {
function add_raw (line 545) | pub fn add_raw<'a: 'h, 'b: 'h, N, V>(&mut self, name: N, value: V)
function add_all (line 577) | pub fn add_all<'n, H>(&mut self, name: H, values: &mut Vec<Cow<'h, str>>)
function remove (line 603) | pub fn remove(&mut self, name: &str) {
function remove_all (line 644) | pub fn remove_all(&mut self) -> Vec<Header<'h>> {
function iter (line 690) | pub fn iter(&self) -> impl Iterator<Item=Header<'_>> {
function into_iter_raw (line 704) | pub fn into_iter_raw(self) -> impl Iterator<Item=(Uncased<'h>, Vec<Cow<'...
type Item (line 752) | type Item = Header<'h>;
type IntoIter (line 754) | type IntoIter = IntoIter<'h>;
method into_iter (line 756) | fn into_iter(self) -> Self::IntoIter {
type IntoIter (line 767) | pub struct IntoIter<'h> {
type Item (line 773) | type Item = Header<'h>;
method next (line 775) | fn next(&mut self) -> Option<Self::Item> {
function from (line 790) | fn from(cookie: cookie::Cookie<'_>) -> Header<'static> {
function from (line 796) | fn from(cookie: &cookie::Cookie<'_>) -> Header<'static> {
function case_insensitive_add_get (line 806) | fn case_insensitive_add_get() {
function case_insensitive_multiadd (line 818) | fn case_insensitive_multiadd() {
FILE: core/http/src/header/media_type.rs
type MediaType (line 50) | pub struct MediaType {
method new (line 288) | pub fn new<T, S>(top: T, sub: S) -> MediaType
method with_params (line 324) | pub fn with_params<K, V, P>(mut self, ps: P) -> MediaType
method const_new (line 353) | pub const fn const_new(
method new_known (line 367) | pub(crate) const fn new_known(
method known_source (line 381) | pub(crate) fn known_source(&self) -> Option<&'static str> {
method top (line 408) | pub fn top(&self) -> &UncasedStr {
method sub (line 427) | pub fn sub(&self) -> &UncasedStr {
method specificity (line 456) | pub fn specificity(&self) -> u8 {
method exact_eq (line 492) | pub fn exact_eq(&self, other: &MediaType) -> bool {
method params (line 524) | pub fn params(&self) -> impl Iterator<Item=(&'_ UncasedStr, &'_ str)> ...
method param (line 540) | pub fn param<'a>(&'a self, name: &str) -> Option<&'a str> {
method fmt (line 581) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type MediaParams (line 63) | pub(crate) enum MediaParams {
method extend (line 612) | fn extend<T>(&mut self, iter: T)
type Source (line 69) | pub(crate) enum Source {
method from (line 76) | fn from(custom: Cow<'static, str>) -> Source {
method as_str (line 624) | fn as_str(&self) -> Option<&str> {
type Err (line 554) | type Err = String;
method from_str (line 557) | fn from_str(raw: &str) -> Result<MediaType, String> {
method eq (line 564) | fn eq(&self, other: &MediaType) -> bool {
method hash (line 573) | fn hash<H: Hasher>(&self, state: &mut H) {
type Item (line 596) | type Item = Self;
type IntoIter (line 598) | type IntoIter = std::iter::Once<Self>;
method into_iter (line 600) | fn into_iter(self) -> Self::IntoIter {
method default (line 606) | fn default() -> Self {
FILE: core/http/src/header/proxy_proto.rs
type ProxyProto (line 23) | pub enum ProxyProto<'a> {
function is_https (line 43) | pub fn is_https(&self) -> bool {
function from (line 49) | fn from(value: &'a str) -> ProxyProto<'a> {
function fmt (line 59) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
FILE: core/http/src/lib.rs
type HttpVersion (line 46) | pub enum HttpVersion {
FILE: core/http/src/method.rs
method supports_payload (line 308) | pub const fn supports_payload(self) -> bool {
type ParseMethodError (line 319) | pub struct ParseMethodError;
method from (line 324) | fn from(infallible: std::convert::Infallible) -> Self {
method fmt (line 330) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type Err (line 336) | type Err = ParseMethodError;
method from_str (line 339) | fn from_str(s: &str) -> Result<Self, Self::Err> {
type Error (line 345) | type Error = ParseMethodError;
method try_from (line 347) | fn try_from(s: &str) -> Result<Self, Self::Error> {
method as_ref (line 353) | fn as_ref(&self) -> &str {
method fmt (line 359) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method eq (line 365) | fn eq(&self, other: &&Method) -> bool {
function eq (line 371) | fn eq(&self, other: &Method) -> bool {
method serialize (line 384) | fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Er...
type DeVisitor (line 389) | struct DeVisitor;
type Value (line 392) | type Value = Method;
method expecting (line 394) | fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
method visit_str (line 398) | fn visit_str<E: Error>(self, v: &str) -> Result<Self::Value, E> {
method deserialize (line 404) | fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, D:...
FILE: core/http/src/parse/accept.rs
type Input (line 8) | type Input<'a> = pear::input::Pear<pear::input::Cursor<&'a str>>;
type Result (line 9) | type Result<'a, T> = pear::input::Result<T, Input<'a>>;
function weighted_media_type (line 12) | fn weighted_media_type<'a>(input: &mut Input<'a>) -> Result<'a, QMediaTy...
function accept (line 33) | fn accept<'a>(input: &mut Input<'a>) -> Result<'a, Accept> {
function parse_accept (line 38) | pub fn parse_accept(input: &str) -> Result<'_, Accept> {
function check_does_parse (line 67) | fn check_does_parse() {
function check_parse_eq (line 82) | fn check_parse_eq() {
FILE: core/http/src/parse/checkers.rs
function is_whitespace (line 2) | pub fn is_whitespace(&byte: &char) -> bool {
function is_valid_token (line 7) | pub fn is_valid_token(&c: &char) -> bool {
FILE: core/http/src/parse/indexed.rs
type IndexedStr (line 13) | pub type IndexedStr<'a> = Indexed<'a, str>;
type IndexedBytes (line 14) | pub type IndexedBytes<'a> = Indexed<'a, [u8]>;
type AsPtr (line 16) | pub trait AsPtr {
method as_ptr (line 17) | fn as_ptr(&self) -> *const u8;
method as_ptr (line 22) | fn as_ptr(&self) -> *const u8 {
method as_ptr (line 29) | fn as_ptr(&self) -> *const u8 {
type Indexed (line 36) | pub enum Indexed<'a, T: ?Sized + ToOwned> {
function from (line 44) | fn from(e: Extent<A>) -> Self {
function from (line 51) | fn from(value: Cow<'a, T>) -> Indexed<'a, T> {
function indices (line 59) | pub fn indices(self) -> (usize, usize) {
function coerce (line 68) | pub fn coerce<U: ?Sized + ToOwned>(self) -> Indexed<'a, U> {
function coerce_lifetime (line 77) | pub fn coerce_lifetime<'b>(self) -> Indexed<'b, T> {
type Owned (line 86) | type Owned = Indexed<'static, T>;
method into_owned (line 88) | fn into_owned(self) -> Indexed<'static, T> {
type Output (line 99) | type Output = Indexed<'a, T>;
method add (line 102) | fn add(self, other: Indexed<'a, T>) -> Indexed<'a, T> {
function checked_from (line 118) | pub fn checked_from(needle: &T, haystack: &T) -> Option<Indexed<'a, T>> {
function unchecked_from (line 143) | pub unsafe fn unchecked_from(needle: &T, haystack: &T) -> Indexed<'a, T> {
function is_indexed (line 154) | pub fn is_indexed(&self) -> bool {
function is_empty (line 163) | pub fn is_empty(&self) -> bool {
function into_concrete (line 172) | pub fn into_concrete(self, source: &Option<Cow<'_, T>>) -> Cow<'a, T> {
function from_cow_source (line 190) | pub fn from_cow_source<'s>(&'s self, source: &'s Option<Cow<'_, T>>) -> ...
function from_source (line 208) | pub fn from_source<'s>(&'s self, source: Option<&'s T>) -> &'s T {
method clone (line 221) | fn clone(&self) -> Self {
method fmt (line 232) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method len (line 242) | fn len(&self) -> usize {
FILE: core/http/src/parse/media_type.rs
type Input (line 11) | type Input<'a> = pear::input::Pear<pear::input::Cursor<&'a str>>;
type Result (line 12) | type Result<'a, T> = pear::input::Result<T, Input<'a>>;
function quoted_string (line 15) | fn quoted_string<'a>(input: &mut Input<'a>) -> Result<'a, Extent<&'a str...
function media_param (line 30) | fn media_param<'a>(input: &mut Input<'a>) -> Result<'a, (Extent<&'a str>...
function media_type (line 41) | pub fn media_type<'a>(input: &mut Input<'a>) -> Result<'a, MediaType> {
function parse_media_type (line 61) | pub fn parse_media_type(input: &str) -> Result<'_, MediaType> {
function check_does_parse (line 111) | fn check_does_parse() {
function check_parse_eq (line 118) | fn check_parse_eq() {
function check_param_eq (line 137) | fn check_param_eq() {
function check_params_do_parse (line 206) | fn check_params_do_parse() {
function test_bad_parses (line 216) | fn test_bad_parses() {
FILE: core/http/src/parse/uri/error.rs
type Error (line 16) | pub struct Error<'a> {
function from (line 23) | fn from(inner: ParseError<RawInput<'a>>) -> Self {
function index (line 42) | pub fn index(&self) -> usize {
function fmt (line 48) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type Owned (line 54) | type Owned = Error<'static>;
method into_owned (line 56) | fn into_owned(self) -> Error<'static> {
function check_display (line 78) | fn check_display() {
FILE: core/http/src/parse/uri/mod.rs
type RawInput (line 13) | type RawInput<'a> = pear::input::Pear<pear::input::Cursor<&'a [u8]>>;
function from_str (line 16) | pub fn from_str(s: &str) -> Result<Uri<'_>, Error<'_>> {
function origin_from_str (line 21) | pub fn origin_from_str(s: &str) -> Result<Origin<'_>, Error<'_>> {
function authority_from_str (line 26) | pub fn authority_from_str(s: &str) -> Result<Authority<'_>, Error<'_>> {
function authority_from_bytes (line 31) | pub fn authority_from_bytes(s: &[u8]) -> Result<Authority<'_>, Error<'_>> {
function scheme_from_str (line 36) | pub fn scheme_from_str(s: &str) -> Result<&str, Error<'_>> {
function absolute_from_str (line 42) | pub fn absolute_from_str(s: &str) -> Result<Absolute<'_>, Error<'_>> {
function asterisk_from_str (line 47) | pub fn asterisk_from_str(s: &str) -> Result<Asterisk, Error<'_>> {
function reference_from_str (line 52) | pub fn reference_from_str(s: &str) -> Result<Reference<'_>, Error<'_>> {
FILE: core/http/src/parse/uri/parser.rs
type Result (line 10) | type Result<'a, T> = pear::input::Result<T, RawInput<'a>>;
function complete (line 22) | pub fn complete<I, P, O>(input: &mut Pear<I>, p: P) -> input::Result<O, I>
function uri (line 34) | pub fn uri<'a>(input: &mut RawInput<'a>) -> Result<'a, Uri<'a>> {
function asterisk (line 47) | pub fn asterisk<'a>(input: &mut RawInput<'a>) -> Result<'a, Asterisk> {
function origin (line 53) | pub fn origin<'a>(input: &mut RawInput<'a>) -> Result<'a, Origin<'a>> {
function authority (line 59) | pub fn authority<'a>(input: &mut RawInput<'a>) -> Result<'a, Authority<'...
function scheme (line 84) | pub fn scheme<'a>(input: &mut RawInput<'a>) -> Result<'a, Extent<&'a [u8...
function absolute (line 94) | pub fn absolute<'a>(input: &mut RawInput<'a>) -> Result<'a, Absolute<'a>> {
function reference (line 101) | pub fn reference<'a>(
function hier_part (line 131) | pub fn hier_part<'a>(
function host (line 145) | fn host<'a>(
function port (line 155) | fn port<'a>(
function maybe_port (line 169) | fn maybe_port<'a>(input: &mut RawInput<'a>, bytes: &[u8]) -> Result<'a, ...
function path (line 191) | fn path<'a>(input: &mut RawInput<'a>) -> Result<'a, Extent<&'a [u8]>> {
function query (line 196) | fn query<'a>(input: &mut RawInput<'a>) -> Result<'a, Option<Extent<&'a [...
function fragment (line 201) | fn fragment<'a>(input: &mut RawInput<'a>) -> Result<'a, Option<Extent<&'...
FILE: core/http/src/parse/uri/tables.rs
function char_table (line 3) | const fn char_table(sets: &[&[u8]]) -> [u8; 256] {
constant ALPHA (line 23) | const ALPHA: &[u8] = &[
constant DIGIT (line 31) | const DIGIT: &[u8] = &[
constant PCT_ENCODED (line 35) | const PCT_ENCODED: &[u8] = &[
constant SUB_DELIMS (line 40) | const SUB_DELIMS: &[u8] = &[
constant SCHEME_CHAR (line 44) | const SCHEME_CHAR: [u8; 256] = char_table(&[
constant UNRESERVED (line 48) | const UNRESERVED: [u8; 256] = char_table(&[
constant REG_NAME_CHARS (line 52) | const REG_NAME_CHARS: [u8; 256] = char_table(&[
constant USER_INFO_CHARS (line 56) | const USER_INFO_CHARS: [u8; 256] = char_table(&[
constant PATH_CHARS (line 60) | pub const PATH_CHARS: [u8; 256] = char_table(&[
constant QUERY_CHARS (line 68) | const QUERY_CHARS: [u8; 256] = char_table(&[
function is_pchar (line 77) | pub const fn is_pchar(&c: &u8) -> bool { PATH_CHARS[c as usize] != 0 }
function is_host_char (line 80) | pub const fn is_host_char(c: &u8) -> bool { is_pchar(c) && *c != b'[' &&...
function is_scheme_char (line 83) | pub const fn is_scheme_char(&c: &u8) -> bool { SCHEME_CHAR[c as usize] !...
function is_user_info_char (line 86) | pub const fn is_user_info_char(&c: &u8) -> bool { USER_INFO_CHARS[c as u...
function is_qchar (line 89) | pub const fn is_qchar(&c: &u8) -> bool { QUERY_CHARS[c as usize] != 0 }
function is_reg_name_char (line 92) | pub const fn is_reg_name_char(&c: &u8) -> bool { REG_NAME_CHARS[c as usi...
function test_char_table (line 96) | fn test_char_table(table: &[u8]) {
function check_tables (line 105) | fn check_tables() {
FILE: core/http/src/parse/uri/tests.rs
function test_assert_parse_eq (line 74) | fn test_assert_parse_eq() {
function test_assert_parse_eq_consecutive (line 80) | fn test_assert_parse_eq_consecutive() {
function test_assert_no_parse (line 89) | fn test_assert_no_parse() {
function bad_parses (line 94) | fn bad_parses() {
function test_parse_issue_924_samples (line 111) | fn test_parse_issue_924_samples() {
function single_byte (line 130) | fn single_byte() {
function origin (line 149) | fn origin() {
function authority (line 169) | fn authority() {
function absolute (line 190) | fn absolute() {
function reference (line 235) | fn reference() {
function display (line 268) | fn display() {
FILE: core/http/src/raw_str.rs
type RawStr (line 51) | pub struct RawStr(str);
method new (line 97) | pub fn new<S: AsRef<str> + ?Sized>(string: &S) -> &RawStr {
method from_cow_str (line 116) | pub fn from_cow_str(cow: Cow<'_, str>) -> Cow<'_, RawStr> {
method into_cow_str (line 138) | pub fn into_cow_str(cow: Cow<'_, RawStr>) -> Cow<'_, str> {
method _percent_decode (line 146) | fn _percent_decode(&self) -> percent_encoding::PercentDecode<'_> {
method percent_decode (line 179) | pub fn percent_decode(&self) -> Result<Cow<'_, str>, Utf8Error> {
method percent_decode_lossy (line 215) | pub fn percent_decode_lossy(&self) -> Cow<'_, str> {
method _replace_plus (line 225) | fn _replace_plus(&self) -> Cow<'_, str> {
method percent_encode (line 266) | pub fn percent_encode(&self) -> Cow<'_, RawStr> {
method percent_encode_bytes (line 284) | pub fn percent_encode_bytes(bytes: &[u8]) -> Cow<'_, RawStr> {
method url_decode (line 306) | pub fn url_decode(&self) -> Result<Cow<'_, str>, Utf8Error> {
method url_decode_lossy (line 343) | pub fn url_decode_lossy(&self) -> Cow<'_, str> {
method html_escape (line 395) | pub fn html_escape(&self) -> Cow<'_, str> {
method len (line 475) | pub const fn len(&self) -> usize {
method is_empty (line 494) | pub const fn is_empty(&self) -> bool {
method as_str (line 513) | pub const fn as_str(&self) -> &str {
method as_bytes (line 529) | pub const fn as_bytes(&self) -> &[u8] {
method as_ptr (line 555) | pub const fn as_ptr(&self) -> *const u8 {
method as_uncased_str (line 574) | pub fn as_uncased_str(&self) -> &UncasedStr {
method contains (line 602) | pub fn contains<'a, P: Pattern<'a>>(&'a self, pat: P) -> bool {
method starts_with (line 629) | pub fn starts_with<'a, P: Pattern<'a>>(&'a self, pat: P) -> bool {
method ends_with (line 656) | pub fn ends_with<'a, P>(&'a self, pat: P) -> bool
method find (line 685) | pub fn find<'a, P: Pattern<'a>>(&'a self, pat: P) -> Option<usize> {
method split (line 713) | pub fn split<'a, P>(&'a self, pat: P) -> impl DoubleEndedIterator<Item...
method split_at_byte (line 768) | pub fn split_at_byte(&self, b: u8) -> (&RawStr, &RawStr) {
method strip_prefix (line 809) | pub fn strip_prefix<'a, P: Pattern<'a>>(&'a self, prefix: P) -> Option...
method strip_suffix (line 835) | pub fn strip_suffix<'a, P>(&'a self, suffix: P) -> Option<&'a RawStr>
method trim (line 859) | pub fn trim(&self) -> &RawStr {
method parse (line 889) | pub fn parse<F: std::str::FromStr>(&self) -> Result<F, F::Err> {
method fmt (line 920) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method as_ref (line 998) | fn as_ref(&self) -> &str {
method as_ref (line 1005) | fn as_ref(&self) -> &std::ffi::OsStr {
method as_ref (line 1019) | fn as_ref(&self) -> &RawStr {
method as_ref (line 1026) | fn as_ref(&self) -> &[u8] {
type Output (line 1032) | type Output = RawStr;
method index (line 1035) | fn index(&self, index: I) -> &Self::Output {
method borrow (line 1042) | fn borrow(&self) -> &str {
method fmt (line 1056) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type Owned (line 54) | type Owned = RawStrBuf;
method to_owned (line 56) | fn to_owned(&self) -> Self::Owned {
type RawStrBuf (line 64) | pub struct RawStrBuf(String);
method into_string (line 78) | pub fn into_string(self) -> String {
method as_ref (line 1063) | fn as_ref(&self) -> &RawStr {
method borrow (line 1070) | fn borrow(&self) -> &RawStr {
type Target (line 1076) | type Target = RawStr;
method deref (line 1079) | fn deref(&self) -> &Self::Target {
method fmt (line 1086) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method fmt (line 1093) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method from (line 1100) | fn from(string: String) -> Self {
method from (line 1107) | fn from(string: &str) -> Self {
method from (line 1114) | fn from(raw: &RawStr) -> Self {
method serialize (line 901) | fn serialize<S>(&self, ser: S) -> Result<S::Ok, S::Error>
function deserialize (line 909) | fn deserialize<D>(de: D) -> Result<Self, D::Error>
function from (line 927) | fn from(string: &'a str) -> &'a RawStr {
function from (line 933) | fn from(raw: &'a RawStr) -> Self {
function from (line 939) | fn from(raw: RawStrBuf) -> Self {
function as_ref (line 1012) | fn as_ref(&self) -> &RawStr {
function borrow (line 1049) | fn borrow(&self) -> &RawStr {
function can_compare (line 1124) | fn can_compare() {
FILE: core/http/src/status.rs
type StatusClass (line 5) | pub enum StatusClass {
type Status (line 116) | pub struct Status {
method fmt (line 352) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method deserialize (line 397) | fn deserialize<D: Deserializer<'de>>(deserializer: D) -> Result<Self, ...
method default (line 122) | fn default() -> Self {
method serialize (line 365) | fn serialize<S: Serializer>(&self, serializer: S) -> Result<S::Ok, S::Er...
type DeVisitor (line 370) | struct DeVisitor;
type Value (line 373) | type Value = Status;
method expecting (line 375) | fn expecting(&self, formatter: &mut fmt::Formatter<'_>) -> fmt::Result {
method visit_i64 (line 379) | fn visit_i64<E: Error>(self, v: i64) -> Result<Self::Value, E> {
method visit_u64 (line 387) | fn visit_u64<E: Error>(self, v: u64) -> Result<Self::Value, E> {
FILE: core/http/src/uri/absolute.rs
type Absolute (line 94) | pub struct Absolute<'a> {
function parse (line 126) | pub fn parse(string: &'a str) -> Result<Absolute<'a>, Error<'a>> {
function parse_owned (line 150) | pub fn parse_owned(string: String) -> Result<Absolute<'static>, Error<'s...
function scheme (line 175) | pub fn scheme(&self) -> &str {
function authority (line 195) | pub fn authority(&self) -> Option<&Authority<'a>> {
function path (line 212) | pub fn path(&self) -> Path<'_> {
function query (line 229) | pub fn query(&self) -> Option<Query<'_>> {
function clear_query (line 246) | pub fn clear_query(&mut self) {
function is_normalized (line 274) | pub fn is_normalized(&self) -> bool {
function normalize (line 307) | pub fn normalize(&mut self) {
function into_normalized (line 341) | pub fn into_normalized(mut self) -> Self {
function set_authority (line 364) | pub fn set_authority(&mut self, authority: Authority<'a>) {
function with_authority (line 386) | pub fn with_authority(mut self, authority: Authority<'a>) -> Self {
function raw (line 400) | pub(crate) unsafe fn raw(
function new (line 418) | pub fn new(
function const_new (line 430) | pub const fn const_new(
function set_path (line 455) | pub(crate) fn set_path<P>(&mut self, path: P)
function set_query (line 462) | pub(crate) fn set_query<Q: Into<Option<Cow<'a, str>>>>(&mut self, query:...
function fmt (line 472) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
FILE: core/http/src/uri/asterisk.rs
type Asterisk (line 24) | pub struct Asterisk;
method parse (line 43) | pub fn parse(string: &str) -> Result<Asterisk, Error<'_>> {
method parse_owned (line 59) | pub fn parse_owned(string: String) -> Result<Asterisk, Error<'static>> {
method fmt (line 65) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
FILE: core/http/src/uri/authority.rs
type Authority (line 47) | pub struct Authority<'a> {
function raw (line 57) | pub(crate) unsafe fn raw(
function new (line 73) | pub fn new(
function const_new (line 83) | pub const fn const_new(user_info: Option<&'a str>, host: &'a str, port: ...
function parse (line 119) | pub fn parse(string: &'a str) -> Result<Authority<'a>, Error<'a>> {
function parse_owned (line 142) | pub fn parse_owned(string: String) -> Result<Authority<'static>, Error<'...
function user_info (line 164) | pub fn user_info(&self) -> Option<&str> {
function host (line 184) | pub fn host(&self) -> &str {
function port (line 206) | pub fn port(&self) -> Option<u16> {
function set_port (line 228) | pub fn set_port<T: Into<Option<u16>>>(&mut self, port: T) {
method fmt (line 238) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
FILE: core/http/src/uri/error.rs
type TryFromUriError (line 9) | pub struct TryFromUriError(pub(crate) ());
method fmt (line 12) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type PathError (line 23) | pub enum PathError {
method fmt (line 33) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
FILE: core/http/src/uri/fmt/encoding.rs
type UNSAFE_ENCODE_SET (line 12) | pub struct UNSAFE_ENCODE_SET<P: Part>(PhantomData<P>);
type EncodeSet (line 14) | pub trait EncodeSet {
constant SET (line 15) | const SET: AsciiSet;
constant SET (line 42) | const SET: AsciiSet = PATH_SET
constant SET (line 47) | const SET: AsciiSet = PATH_SET
constant SET (line 58) | const SET: AsciiSet = <UNSAFE_ENCODE_SET<Path>>::SET
constant SET (line 63) | const SET: AsciiSet = <UNSAFE_ENCODE_SET<Query>>::SET
constant SET (line 75) | const SET: AsciiSet = <ENCODE_SET<Path>>::SET
function set_from_table (line 18) | const fn set_from_table(table: &'static [u8; 256]) -> AsciiSet {
constant PATH_SET (line 34) | const PATH_SET: AsciiSet = set_from_table(&PATH_CHARS);
method default (line 38) | fn default() -> Self { UNSAFE_ENCODE_SET(PhantomData) }
type ENCODE_SET (line 55) | pub struct ENCODE_SET<P: Part>(PhantomData<P>);
type DEFAULT_ENCODE_SET (line 70) | pub struct DEFAULT_ENCODE_SET;
function percent_encode (line 84) | pub fn percent_encode<S: EncodeSet + Default>(string: &RawStr) -> Cow<'_...
function percent_encode_bytes (line 88) | pub fn percent_encode_bytes<S: EncodeSet + Default>(bytes: &[u8]) -> Cow...
FILE: core/http/src/uri/fmt/formatter.rs
type Formatter (line 143) | pub struct Formatter<'i, P: Part> {
function new (line 153) | pub(crate) fn new(inner: &'i mut (dyn Write + 'i)) -> Self {
function refreshed (line 164) | fn refreshed<F: FnOnce(&mut Self) -> fmt::Result>(&mut self, f: F) -> fm...
function write_raw (line 202) | pub fn write_raw<S: AsRef<str>>(&mut self, string: S) -> fmt::Result {
function write_value (line 259) | pub fn write_value<T: UriDisplay<P>>(&mut self, value: T) -> fmt::Result {
function refresh (line 314) | pub fn refresh(&mut self) {
function with_prefix (line 320) | fn with_prefix<F>(&mut self, prefix: &str, f: F) -> fmt::Result
function write_named_value (line 392) | pub fn write_named_value<T: UriDisplay<Query>>(&mut self, name: &str, va...
function write_str (line 398) | fn write_str(&mut self, s: &str) -> fmt::Result {
type UriArgumentsKind (line 405) | pub enum UriArgumentsKind<A> {
type UriQueryArgument (line 412) | pub enum UriQueryArgument<'a> {
type Void (line 420) | pub struct Void;
type ValidRoutePrefix (line 424) | pub trait ValidRoutePrefix {
method append (line 427) | fn append(self, path: Cow<'static, str>, query: Option<Cow<'static, st...
type Output (line 431) | type Output = Self;
method append (line 433) | fn append(self, path: Cow<'static, str>, query: Option<Cow<'static, st...
type Output (line 460) | type Output = Self;
method append (line 462) | fn append(self, path: Cow<'static, str>, query: Option<Cow<'static, st...
type ValidRouteSuffix (line 490) | pub trait ValidRouteSuffix<T> {
method prepend (line 493) | fn prepend(self, prefix: T) -> Self::Output;
type Output (line 497) | type Output = Self;
function prepend (line 499) | fn prepend(self, prefix: Origin<'a>) -> Self::Output {
type Output (line 505) | type Output = Self;
function prepend (line 507) | fn prepend(self, prefix: Absolute<'a>) -> Self::Output {
type Output (line 513) | type Output = Origin<'a>;
function prepend (line 515) | fn prepend(self, mut prefix: Origin<'a>) -> Self::Output {
type Output (line 527) | type Output = Self;
function prepend (line 529) | fn prepend(self, mut prefix: Absolute<'a>) -> Self::Output {
type RouteUriBuilder (line 542) | pub struct RouteUriBuilder {
method new (line 559) | pub fn new(
method with_prefix (line 599) | pub fn with_prefix<P: ValidRoutePrefix>(self, p: P) -> PrefixedRouteUr...
method with_suffix (line 603) | pub fn with_suffix<S>(self, suffix: S) -> SuffixedRouteUri<S::Output>
method render (line 609) | pub fn render(self) -> Origin<'static> {
type PrefixedRouteUri (line 549) | pub struct PrefixedRouteUri<T>(T);
type SuffixedRouteUri (line 553) | pub struct SuffixedRouteUri<T>(T);
function with_suffix (line 616) | pub fn with_suffix<S: ValidRouteSuffix<T>>(self, suffix: S) -> SuffixedR...
function render (line 620) | pub fn render(self) -> T {
function render (line 627) | pub fn render(self) -> T {
type MyValue (line 637) | struct MyValue;
method fmt (line 640) | fn fmt(&self, _f: &mut Formatter<'_, Query>) -> std::fmt::Result {
type MyDisplay (line 645) | struct MyDisplay;
method fmt (line 648) | fn fmt(&self, formatter: &mut Formatter<'_, Query>) -> std::fmt::Result {
function check_consistency (line 677) | fn check_consistency() {
FILE: core/http/src/uri/fmt/from_uri_param.rs
type FromUriParam (line 188) | pub trait FromUriParam<P: Part, T> {
method from_uri_param (line 195) | fn from_uri_param(param: T) -> Self::Target;
type Target (line 351) | type Target = &'a Path;
method from_uri_param (line 354) | fn from_uri_param(param: &'a str) -> &'a Path {
type Target (line 361) | type Target = &'b Path;
method from_uri_param (line 364) | fn from_uri_param(param: &'a &'b str) -> &'b Path {
type Target (line 371) | type Target = T::Target;
function from_uri_param (line 374) | fn from_uri_param(param: A) -> Self::Target {
type Target (line 383) | type Target = T::Target;
function from_uri_param (line 386) | fn from_uri_param(param: A) -> Self::Target {
type Target (line 394) | type Target = Either<T::Target, U::Target>;
function from_uri_param (line 396) | fn from_uri_param(param: Either<A, B>) -> Self::Target {
type Target (line 405) | type Target = Option<T::Target>;
function from_uri_param (line 408) | fn from_uri_param(param: Option<A>) -> Self::Target {
type Target (line 414) | type Target = Option<T::Target>;
function from_uri_param (line 417) | fn from_uri_param(param: Option<A>) -> Self::Target {
type Target (line 423) | type Target = Result<T::Target, E>;
function from_uri_param (line 426) | fn from_uri_param(param: Result<A, E>) -> Self::Target {
type Target (line 432) | type Target = Result<T::Target, E>;
function from_uri_param (line 435) | fn from_uri_param(param: Result<A, E>) -> Self::Target {
FILE: core/http/src/uri/fmt/part.rs
type Part (line 25) | pub trait Part: private::Sealed {
constant KIND (line 28) | const KIND: Kind;
constant DELIMITER (line 33) | const DELIMITER: char;
constant KIND (line 75) | const KIND: Kind = Kind::Path;
constant DELIMITER (line 76) | const DELIMITER: char = '/';
type Raw (line 77) | type Raw = IndexedStr<'static>;
constant KIND (line 81) | const KIND: Kind = Kind::Query;
constant DELIMITER (line 82) | const DELIMITER: char = '&';
type Raw (line 83) | type Raw = (IndexedStr<'static>, IndexedStr<'static>);
type Sealed (line 41) | pub trait Sealed {}
type Kind (line 49) | pub enum Kind { Path, Query }
type Path (line 61) | pub enum Path { }
type Query (line 72) | pub enum Query { }
FILE: core/http/src/uri/fmt/uri_display.rs
type UriDisplay (line 291) | pub trait UriDisplay<P: Part> {
method fmt (line 293) | fn fmt(&self, f: &mut Formatter<'_, P>) -> fmt::Result;
function fmt (line 298) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
function fmt (line 308) | fn fmt(&self, f: &mut Formatter<'_, P>) -> fmt::Result {
function fmt (line 315) | fn fmt(&self, f: &mut Formatter<'_, Path>) -> fmt::Result {
method fmt (line 396) | fn fmt(&self, f: &mut Formatter<'_, P>) -> fmt::Result {
function fmt (line 404) | fn fmt(&self, f: &mut Formatter<'_, P>) -> fmt::Result {
function fmt (line 412) | fn fmt(&self, f: &mut Formatter<'_, Path>) -> fmt::Result {
function fmt (line 420) | fn fmt(&self, f: &mut Formatter<'_, P>) -> fmt::Result {
function fmt (line 428) | fn fmt(&self, f: &mut Formatter<'_, P>) -> fmt::Result {
function fmt (line 439) | fn fmt(&self, f: &mut Formatter<'_, P>) -> fmt::Result {
function fmt (line 447) | fn fmt(&self, f: &mut Formatter<'_, Query>) -> fmt::Result {
function fmt (line 458) | fn fmt(&self, f: &mut Formatter<'_, Query>) -> fmt::Result {
function fmt (line 467) | fn fmt(&self, f: &mut Formatter<'_, Query>) -> fmt::Result {
function fmt (line 473) | fn fmt(&self, f: &mut Formatter<'_, Query>) -> fmt::Result {
function fmt (line 479) | fn fmt(&self, f: &mut Formatter<'_, Query>) -> fmt::Result {
function fmt (line 485) | fn fmt(&self, f: &mut Formatter<'_, Query>) -> fmt::Result {
function fmt (line 503) | fn fmt(&self, f: &mut Formatter<'_, Query>) -> fmt::Result {
type Ignorable (line 558) | pub trait Ignorable<P: Part> { }
function assert_ignorable (line 564) | pub fn assert_ignorable<P: Part, T: Ignorable<P>>() { }
function uri_display_encoding (line 587) | fn uri_display_encoding() {
function paths (line 630) | fn paths() {
type Wrapper (line 643) | struct Wrapper<T>(T);
type Target (line 646) | type Target = T::Target;
function from_uri_param (line 649) | fn from_uri_param(param: A) -> Self::Target {
type Target (line 655) | type Target = usize;
function from_uri_param (line 658) | fn from_uri_param(param: usize) -> Self::Target {
function uri_display_encoding_wrapped (line 664) | fn uri_display_encoding_wrapped() {
function check_ignorables (line 677) | fn check_ignorables() {
FILE: core/http/src/uri/host.rs
type Host (line 91) | pub struct Host<'a>(Authority<'a>);
function new (line 110) | pub const fn new(authority: Authority<'a>) -> Self {
function parse (line 143) | pub fn parse(string: &'a str) -> Result<Host<'a>, Error<'a>> {
function parse_bytes (line 149) | pub fn parse_bytes(bytes: &'a [u8]) -> Result<Host<'a>, Error<'a>> {
function parse_owned (line 172) | pub fn parse_owned(string: String) -> Result<Host<'static>, Error<'stati...
function domain (line 194) | pub fn domain(&self) -> &UncasedStr {
function port (line 218) | pub fn port(&self) -> Option<u16> {
function to_authority (line 252) | pub fn to_authority<'h, W>(&self, whitelist: W) -> Option<Authority<'a>>
function to_absolute (line 290) | pub fn to_absolute<'h, W>(&self, scheme: &'a str, whitelist: W) -> Optio...
type Owned (line 304) | type Owned = Host<'static>;
function into_owned (line 306) | fn into_owned(self) -> Host<'static> {
function from (line 312) | fn from(auth: Authority<'a>) -> Self {
method fmt (line 318) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
FILE: core/http/src/uri/origin.rs
type Origin (line 115) | pub struct Origin<'a> {
function root (line 124) | pub fn root() -> &'static Origin<'static> {
function raw (line 131) | pub(crate) unsafe fn raw(
function new (line 147) | pub fn new<P, Q>(path: P, query: Option<Q>) -> Origin<'a>
function path_only (line 161) | pub fn path_only<P: Into<Cow<'a, str>>>(path: P) -> Origin<'a> {
function const_new (line 169) | pub const fn const_new(path: &'a str, query: Option<&'a str>) -> Origin<...
function set_query (line 186) | pub(crate) fn set_query<Q: Into<Option<Cow<'a, str>>>>(&mut self, query:...
function parse (line 212) | pub fn parse(string: &'a str) -> Result<Origin<'a>, Error<'a>> {
function parse_route (line 219) | pub fn parse_route(string: &'a str) -> Result<Origin<'a>, Error<'a>> {
function parse_owned (line 254) | pub fn parse_owned(string: String) -> Result<Origin<'static>, Error<'sta...
function path (line 278) | pub fn path(&self) -> Path<'_> {
function query (line 296) | pub fn query(&self) -> Option<Query<'_>> {
function map_path (line 331) | pub fn map_path<'s, F, P>(&'s self, f: F) -> Option<Self>
function clear_query (line 358) | pub fn clear_query(&mut self) {
function is_normalized (line 384) | pub fn is_normalized(&self) -> bool {
function _normalize (line 388) | fn _normalize(&mut self, allow_trail: bool) {
function normalize (line 416) | pub fn normalize(&mut self) {
function into_normalized (line 436) | pub fn into_normalized(mut self) -> Self {
function has_trailing_slash (line 459) | pub fn has_trailing_slash(&self) -> bool {
function is_normalized_nontrailing (line 488) | pub fn is_normalized_nontrailing(&self) -> bool {
function into_normalized_nontrailing (line 527) | pub fn into_normalized_nontrailing(mut self) -> Self {
function fmt (line 557) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
function seg_count (line 571) | fn seg_count(path: &str, expected: usize) -> bool {
function eq_segments (line 587) | fn eq_segments(path: &str, expected: &[&str]) -> bool {
function send_and_sync (line 598) | fn send_and_sync() {
function simple_segment_count (line 604) | fn simple_segment_count() {
function segment_count (line 614) | fn segment_count() {
function single_segments_match (line 629) | fn single_segments_match() {
function multi_segments_match (line 646) | fn multi_segments_match() {
function multi_segments_match_funky_chars (line 661) | fn multi_segments_match_funky_chars() {
function segment_mismatch (line 666) | fn segment_mismatch() {
function test_query (line 677) | fn test_query(uri: &str, query: Option<&str>) {
function query_does_not_exist (line 683) | fn query_does_not_exist() {
function query_exists (line 693) | fn query_exists() {
FILE: core/http/src/uri/path_query.rs
type Data (line 14) | pub struct Data<'a, P: Part> {
function raw (line 20) | pub(crate) fn raw(value: Extent<&'a [u8]>) -> Self {
function new (line 26) | pub fn new<S: Into<Cow<'a, str>>>(value: S) -> Self {
type Path (line 36) | pub struct Path<'a> {
type Query (line 43) | pub struct Query<'a> {
function decode_to_indexed_str (line 48) | fn decode_to_indexed_str<P: fmt::Part>(
function raw (line 78) | pub fn raw(&self) -> &'a RawStr {
function as_str (line 92) | pub fn as_str(&self) -> &'a str {
function is_normalized (line 100) | pub(crate) fn is_normalized(&self, absolute: bool) -> bool {
function to_normalized (line 113) | pub(crate) fn to_normalized(self, absolute: bool, trail: bool) -> Data<'...
function raw_segments (line 171) | pub fn raw_segments(&self) -> impl DoubleEndedIterator<Item = &'a RawStr> {
function segments (line 216) | pub fn segments(&self) -> Segments<'a, fmt::Path> {
function raw (line 248) | pub fn raw(&self) -> &'a RawStr {
function as_str (line 262) | pub fn as_str(&self) -> &'a str {
function is_normalized (line 267) | pub(crate) fn is_normalized(&self) -> bool {
function to_normalized (line 272) | pub(crate) fn to_normalized(self) -> Data<'static, fmt::Query> {
function raw_segments (line 325) | pub fn raw_segments(&self) -> impl Iterator<Item = &'a RawStr> {
function segments (line 353) | pub fn segments(&self) -> Segments<'a, fmt::Query> {
FILE: core/http/src/uri/reference.rs
type Reference (line 73) | pub struct Reference<'a> {
function raw (line 84) | pub(crate) unsafe fn raw(
function new (line 104) | pub fn new(
function const_new (line 116) | pub const fn const_new(
function parse (line 171) | pub fn parse(string: &'a str) -> Result<Reference<'a>, Error<'a>> {
function parse_owned (line 195) | pub fn parse_owned(string: String) -> Result<Reference<'static>, Error<'...
function scheme (line 225) | pub fn scheme(&self) -> Option<&str> {
function authority (line 243) | pub fn authority(&self) -> Option<&Authority<'a>> {
function path (line 257) | pub fn path(&self) -> Path<'_> {
function query (line 280) | pub fn query(&self) -> Option<Query<'_>> {
function fragment (line 298) | pub fn fragment(&self) -> Option<&RawStr> {
function is_normalized (line 334) | pub fn is_normalized(&self) -> bool {
function normalize (line 364) | pub fn normalize(&mut self) {
function into_normalized (line 399) | pub fn into_normalized(mut self) -> Self {
function set_path (line 405) | pub(crate) fn set_path<P>(&mut self, path: P)
function with_query_fragment_of (line 412) | pub(crate) fn with_query_fragment_of(mut self, other: Reference<'a>) -> ...
function from (line 434) | fn from(absolute: Absolute<'a>) -> Self {
function from (line 447) | fn from(origin: Origin<'a>) -> Self {
function from (line 460) | fn from(authority: Authority<'a>) -> Self {
function from (line 476) | fn from(_: Asterisk) -> Self {
function fmt (line 489) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
FILE: core/http/src/uri/segments.rs
type Segments (line 36) | pub struct Segments<'a, P: Part> {
function new (line 45) | pub fn new<'a>(source: &'a RawStr, segments: &'a [P::Raw]) -> Segments<'...
function num (line 70) | pub fn num(&self) -> usize {
function is_empty (line 91) | pub fn is_empty(&self) -> bool {
function skip (line 112) | pub fn skip(mut self, n: usize) -> Self {
function get (line 135) | pub fn get(&self, n: usize) -> Option<&'a str> {
function prefix_of (line 172) | pub fn prefix_of(self, other: Segments<'_, Path>) -> bool {
function to_path_buf (line 217) | pub fn to_path_buf(&self, allow_dotfiles: bool) -> Result<PathBuf, PathE...
function get (line 271) | pub fn get(&self, n: usize) -> Option<(&'a str, &'a str)> {
FILE: core/http/src/uri/uri.rs
type Uri (line 36) | pub enum Uri<'a> {
function parse (line 82) | pub fn parse<T>(string: &'a str) -> Result<Uri<'a>, Error<'a>>
function parse_any (line 130) | pub fn parse_any(string: &'a str) -> Result<Uri<'a>, Error<'a>> {
function origin (line 155) | pub fn origin(&self) -> Option<&Origin<'a>> {
function authority (line 183) | pub fn authority(&self) -> Option<&Authority<'a>> {
function absolute (line 211) | pub fn absolute(&self) -> Option<&Absolute<'a>> {
function reference (line 239) | pub fn reference(&self) -> Option<&Reference<'a>> {
function as_utf8_unchecked (line 247) | pub(crate) unsafe fn as_utf8_unchecked(input: Cow<'_, [u8]>) -> Cow<'_, ...
type Owned (line 276) | type Owned = Uri<'static>;
method into_owned (line 278) | fn into_owned(self) -> Uri<'static> {
method fmt (line 290) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
function normalization (line 497) | fn normalization() {
FILE: core/lib/build.rs
function main (line 1) | fn main() {
FILE: core/lib/fuzz/targets/collision-matching.rs
type ArbitraryRequestData (line 11) | struct ArbitraryRequestData<'a> {
type ArbitraryRouteData (line 18) | struct ArbitraryRouteData<'a> {
function fmt (line 25) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
function fmt (line 37) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
function into_local_request (line 49) | fn into_local_request(self, client: &'c Client) -> LocalRequest<'c> {
function into_route (line 61) | fn into_route(self) -> Route {
type ArbitraryMethod (line 70) | struct ArbitraryMethod(Method);
method arbitrary (line 83) | fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
method size_hint (line 87) | fn size_hint(_: usize) -> (usize, Option<usize>) {
type ArbitraryOrigin (line 72) | struct ArbitraryOrigin<'a>(Origin<'a>);
type ArbitraryAccept (line 74) | struct ArbitraryAccept(Accept);
method arbitrary (line 110) | fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
method size_hint (line 115) | fn size_hint(depth: usize) -> (usize, Option<usize>) {
type ArbitraryContentType (line 76) | struct ArbitraryContentType(ContentType);
method arbitrary (line 121) | fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
method size_hint (line 126) | fn size_hint(depth: usize) -> (usize, Option<usize>) {
type ArbitraryMediaType (line 78) | struct ArbitraryMediaType(MediaType);
method arbitrary (line 132) | fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
method size_hint (line 154) | fn size_hint(_: usize) -> (usize, Option<usize>) {
type ArbitraryRouteUri (line 80) | struct ArbitraryRouteUri<'a>(RouteUri<'a>);
function arbitrary (line 93) | fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
function size_hint (line 104) | fn size_hint(_: usize) -> (usize, Option<usize>) {
function arbitrary (line 160) | fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
function size_hint (line 171) | fn size_hint(_: usize) -> (usize, Option<usize>) {
type TestData (line 176) | type TestData<'a> = (
function fuzz (line 182) | fn fuzz((route_a, route_b, req): TestData<'_>) {
function main (line 205) | fn main() {
function main (line 212) | fn main() {
FILE: core/lib/fuzz/targets/uri-normalization.rs
function fuzz (line 6) | fn fuzz(data: &str) {
FILE: core/lib/fuzz/targets/uri-parsing.rs
function fuzz (line 6) | fn fuzz(data: &str) {
FILE: core/lib/fuzz/targets/uri-roundtrip.rs
function fuzz (line 6) | fn fuzz(data: &str) {
FILE: core/lib/src/catcher/catcher.rs
type Catcher (line 113) | pub struct Catcher {
method new (line 178) | pub fn new<S, H>(code: S, handler: H) -> Catcher
method base (line 217) | pub fn base(&self) -> Path<'_> {
method rebase (line 254) | pub fn rebase(mut self, mut base: uri::Origin<'_>) -> Self {
method map_base (line 303) | pub fn map_base<'a, F>(mut self, mapper: F) -> Result<Self, uri::Error...
method from (line 342) | fn from(info: StaticInfo) -> Catcher {
method fmt (line 351) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
function rank (line 137) | fn rank(base: Path<'_>) -> isize {
method default (line 315) | fn default() -> Self {
type StaticInfo (line 328) | pub struct StaticInfo {
FILE: core/lib/src/catcher/handler.rs
type Result (line 6) | pub type Result<'r> = std::result::Result<Response<'r>, crate::http::Sta...
type BoxFuture (line 10) | pub type BoxFuture<'r, T = Result<'r>> = futures::future::BoxFuture<'r, T>;
type Handler (line 92) | pub trait Handler: Cloneable + Send + Sync + 'static {
method handle (line 100) | async fn handle<'r>(&self, status: Status, req: &'r Request<'_>) -> Re...
method handle (line 107) | fn handle<'r, 'life0, 'life1, 'async_trait>(
function dummy_handler (line 123) | pub fn dummy_handler<'r>(_: Status, _: &'r Request<'_>) -> BoxFuture<'r> {
type Sealed (line 128) | pub trait Sealed {}
type Cloneable (line 138) | pub trait Cloneable: private::Sealed {
method clone_handler (line 140) | fn clone_handler(&self) -> Box<dyn Handler>;
method clone_handler (line 144) | fn clone_handler(&self) -> Box<dyn Handler> {
method clone (line 150) | fn clone(&self) -> Box<dyn Handler> {
FILE: core/lib/src/config/cli_colors.rs
type CliColors (line 13) | pub enum CliColors {
method fmt (line 39) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method deserialize (line 49) | fn deserialize<D: de::Deserializer<'de>>(de: D) -> Result<Self, D::Err...
FILE: core/lib/src/config/config.rs
type Config (line 53) | pub struct Config {
method debug_default (line 182) | pub fn debug_default() -> Config {
method release_default (line 218) | pub fn release_default() -> Config {
method figment (line 255) | pub fn figment() -> Figment {
method try_from (line 278) | pub fn try_from<T: Provider>(provider: T) -> Result<Self> {
method from (line 306) | pub fn from<T: Provider>(provider: T) -> Self {
constant DEBUG_PROFILE (line 319) | pub const DEBUG_PROFILE: Profile = Profile::const_new("debug");
constant RELEASE_PROFILE (line 322) | pub const RELEASE_PROFILE: Profile = Profile::const_new("release");
constant DEFAULT_PROFILE (line 326) | pub const DEFAULT_PROFILE: Profile = Self::DEBUG_PROFILE;
constant DEFAULT_PROFILE (line 330) | pub const DEFAULT_PROFILE: Profile = Self::RELEASE_PROFILE;
constant WORKERS (line 336) | pub const WORKERS: &'static str = "workers";
constant MAX_BLOCKING (line 339) | pub const MAX_BLOCKING: &'static str = "max_blocking";
constant KEEP_ALIVE (line 342) | pub const KEEP_ALIVE: &'static str = "keep_alive";
constant IDENT (line 345) | pub const IDENT: &'static str = "ident";
constant IP_HEADER (line 348) | pub const IP_HEADER: &'static str = "ip_header";
constant PROXY_PROTO_HEADER (line 351) | pub const PROXY_PROTO_HEADER: &'static str = "proxy_proto_header";
constant LIMITS (line 354) | pub const LIMITS: &'static str = "limits";
constant SECRET_KEY (line 357) | pub const SECRET_KEY: &'static str = "secret_key";
constant TEMP_DIR (line 360) | pub const TEMP_DIR: &'static str = "temp_dir";
constant LOG_LEVEL (line 363) | pub const LOG_LEVEL: &'static str = "log_level";
constant LOG_FORMAT (line 366) | pub const LOG_FORMAT: &'static str = "log_format";
constant SHUTDOWN (line 369) | pub const SHUTDOWN: &'static str = "shutdown";
constant CLI_COLORS (line 372) | pub const CLI_COLORS: &'static str = "cli_colors";
constant PARAMETERS (line 375) | pub const PARAMETERS: &'static [&'static str] = &[
constant PROFILE (line 385) | const PROFILE: &'static str = "profile";
constant DEPRECATED_KEYS (line 388) | pub(crate) const DEPRECATED_KEYS: &'static [(&'static str, Option<&'st...
constant KNOWN_SECRET_KEYS (line 395) | pub(crate) const KNOWN_SECRET_KEYS: &'static [&'static str] = &[
method default (line 160) | fn default() -> Config {
method metadata (line 402) | fn metadata(&self) -> Metadata {
method data (line 411) | fn data(&self) -> Result<Map<Profile, Dict>> {
method profile (line 426) | fn profile(&self) -> Option<Profile> {
type Error (line 433) | type Error = std::convert::Infallible;
function from_request (line 435) | async fn from_request(req: &'r Request<'_>) -> request::Outcome<Self, Se...
FILE: core/lib/src/config/http_header.rs
function deserialize (line 8) | pub(crate) fn deserialize<'de, D>(de: D) -> Result<Option<Uncased<'stati...
FILE: core/lib/src/config/ident.rs
type Ident (line 78) | pub struct Ident(Option<String>);
method try_new (line 128) | pub fn try_new<S: Into<String>>(ident: S) -> Result<Ident, String> {
method none (line 152) | pub const fn none() -> Ident {
method as_str (line 172) | pub fn as_str(&self) -> Option<&str> {
method deserialize (line 178) | fn deserialize<D: Deserializer<'de>>(de: D) -> Result<Self, D::Error> {
method fmt (line 225) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method default (line 235) | fn default() -> Self {
FILE: core/lib/src/config/secret_key.rs
type SecretKey (line 71) | pub struct SecretKey {
method zero (line 78) | pub(crate) fn zero() -> SecretKey {
method from (line 97) | pub fn from(master: &[u8]) -> SecretKey {
method derive_from (line 116) | pub fn derive_from(material: &[u8]) -> SecretKey {
method generate (line 130) | pub fn generate() -> Option<SecretKey> {
method is_zero (line 145) | pub fn is_zero(&self) -> bool {
method is_provided (line 164) | pub fn is_provided(&self) -> bool {
method serialize_zero (line 169) | pub(crate) fn serialize_zero<S>(&self, ser: S) -> Result<S::Ok, S::Error>
method deserialize (line 193) | fn deserialize<D: de::Deserializer<'de>>(de: D) -> Result<Self, D::Err...
method fmt (line 248) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method fmt (line 261) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method eq (line 177) | fn eq(&self, other: &Self) -> bool {
type Error (line 185) | type Error = std::convert::Infallible;
function from_request (line 187) | async fn from_request(req: &'r Request<'_>) -> Outcome<Self, Self::Error> {
FILE: core/lib/src/config/tests.rs
function test_figment_is_default (line 10) | fn test_figment_is_default() {
function test_default_round_trip (line 20) | fn test_default_round_trip() {
function test_profile_env (line 34) | fn test_profile_env() {
function test_toml_file (line 53) | fn test_toml_file() {
function test_cli_colors (line 116) | fn test_cli_colors() {
function test_profiles_merge (line 211) | fn test_profiles_merge() {
function test_env_vars_merge (line 250) | fn test_env_vars_merge() {
function test_precedence (line 304) | fn test_precedence() {
function test_err_on_non_debug_and_no_secret_key (line 343) | fn test_err_on_non_debug_and_no_secret_key() {
function test_err_on_non_debug2_and_no_secret_key (line 354) | fn test_err_on_non_debug2_and_no_secret_key() {
function test_no_err_on_debug_and_no_secret_key (line 364) | fn test_no_err_on_debug_and_no_secret_key() {
function test_no_err_on_release_and_custom_secret_key (line 379) | fn test_no_err_on_release_and_custom_secret_key() {
FILE: core/lib/src/data/capped.rs
type N (line 4) | pub struct N {
method fmt (line 12) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
type Target (line 18) | type Target = u64;
method deref (line 20) | fn deref(&self) -> &Self::Target {
type Capped (line 65) | pub struct Capped<T> {
function new (line 85) | pub fn new(value: T, n: N) -> Self {
function complete (line 102) | pub fn complete(value: T, len: usize) -> Self {
function map (line 119) | pub fn map<U, F: FnOnce(T) -> U>(self, f: F) -> Capped<U> {
function is_empty (line 140) | pub fn is_empty(&self) -> bool {
function is_complete (line 161) | pub fn is_complete(&self) -> bool {
function into_inner (line 177) | pub fn into_inner(self) -> T {
type Target (line 183) | type Target = T;
function deref (line 185) | fn deref(&self) -> &Self::Target {
function deref_mut (line 191) | fn deref_mut(&mut self) -> &mut Self::Target {
function from (line 198) | fn from(value: T) -> Self {
function respond_to (line 208) | fn respond_to(self, request: &'r Request<'_>) -> response::Result<'o> {
FILE: core/lib/src/data/data.rs
type Data (line 41) | pub struct Data<'r> {
function new (line 50) | pub(crate) fn new(stream: Peekable<512, RawReader<'r>>) -> Self {
function from (line 55) | pub(crate) fn from<S: Into<RawStream<'r>>>(stream: S) -> Data<'r> {
function local (line 61) | pub(crate) fn local(data: Vec<u8>) -> Data<'r> {
function open (line 83) | pub fn open(self, limit: ByteUnit) -> DataStream<'r> {
function peek (line 161) | pub async fn peek(&mut self, num: usize) -> &[u8] {
function peek_complete (line 180) | pub fn peek_complete(&self) -> bool {
function chain_transform (line 189) | pub fn chain_transform<T>(&mut self, transform: T) -> &mut Self
function chain_inspect (line 197) | pub fn chain_inspect<F>(&mut self, f: F) -> &mut Self
function chain_inplace_map (line 206) | pub fn chain_inplace_map<F>(&mut self, mut f: F) -> &mut Self
function chain_try_inplace_map (line 215) | pub fn chain_try_inplace_map<F>(&mut self, f: F) -> &mut Self
FILE: core/lib/src/data/data_stream.rs
type DataStream (line 48) | pub enum DataStream<'r> {
type TransformReader (line 56) | pub struct TransformReader<'r> {
type BaseReader (line 63) | pub type BaseReader<'r> = Take<Chain<Cursor<Vec<u8>>, RawReader<'r>>>;
type RawReader (line 66) | pub type RawReader<'r> = StreamReader<RawStream<'r>, Bytes>;
type RawStream (line 69) | pub enum RawStream<'r> {
function base_mut (line 79) | fn base_mut(&mut self) -> &mut BaseReader<'r> {
function base (line 87) | fn base(&self) -> &BaseReader<'r> {
function new (line 96) | pub(crate) fn new(
function base_mut (line 114) | fn base_mut(&mut self) -> &mut BaseReader<'r> {
function base (line 122) | fn base(&self) -> &BaseReader<'r> {
function limit_exceeded (line 130) | async fn limit_exceeded(&mut self) -> io::Result<bool> {
function hint (line 157) | pub fn hint(&self) -> usize {
function stream_to (line 193) | pub async fn stream_to<W>(mut self, mut writer: W) -> io::Result<N>
function stream_precise_to (line 218) | pub async fn stream_precise_to<W>(mut self, mut writer: W) -> io::Result...
function into_bytes (line 241) | pub async fn into_bytes(self) -> io::Result<Capped<Vec<u8>>> {
function into_string (line 264) | pub async fn into_string(mut self) -> io::Result<Capped<String>> {
function into_file (line 290) | pub async fn into_file<P: AsRef<Path>>(self, path: P) -> io::Result<Capp...
method poll_read (line 298) | fn poll_read(
method poll_read (line 311) | fn poll_read(
type Item (line 338) | type Item = io::Result<Bytes>;
method poll_next (line 340) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
method size_hint (line 356) | fn size_hint(&self) -> (usize, Option<usize>) {
function fmt (line 372) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
function from (line 384) | fn from(value: HyperBody) -> Self {
function from (line 391) | fn from(value: crate::listener::Cancellable<crate::listener::quic::QuicR...
function from (line 397) | fn from(value: multer::Field<'r>) -> Self {
FILE: core/lib/src/data/from_data.rs
type Outcome (line 9) | pub type Outcome<'r, T, E = <T as FromData<'r>>::Error>
type FromData (line 304) | pub trait FromData<'r>: Sized {
method from_data (line 314) | async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> Outcome<'r...
type Error (line 321) | type Error = std::io::Error;
function from_data (line 323) | async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> Outcome<'r, ...
type Error (line 333) | type Error = std::io::Error;
function from_data (line 335) | async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> Outcome<'r, ...
type Error (line 346) | type Error = std::io::Error;
function from_data (line 348) | async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> Outcome<'r, ...
type Error (line 359) | type Error = std::io::Error;
function from_data (line 361) | async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> Outcome<'r, ...
type Error (line 371) | type Error = std::io::Error;
function from_data (line 373) | async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> Outcome<'r, ...
type Error (line 384) | type Error = std::io::Error;
function from_data (line 386) | async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> Outcome<'r, ...
type Error (line 396) | type Error = std::convert::Infallible;
function from_data (line 398) | async fn from_data(_: &'r Request<'_>, data: Data<'r>) -> Outcome<'r, Se...
type Error (line 405) | type Error = std::convert::Infallible;
function from_data (line 407) | async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> Outcome<'r, ...
type Error (line 418) | type Error = std::convert::Infallible;
function from_data (line 420) | async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> Outcome<'r, ...
FILE: core/lib/src/data/io_stream.rs
type IoStream (line 25) | pub struct IoStream {
method from (line 83) | fn from(io: Upgraded) -> Self {
method inner_mut (line 96) | fn inner_mut(&mut self) -> Pin<&mut dyn AsyncReadWrite> {
method inner_is_write_vectored (line 103) | fn inner_is_write_vectored(&self) -> bool {
type IoStreamKind (line 30) | enum IoStreamKind {
type IoHandler (line 69) | pub trait IoHandler: Send {
method io (line 71) | async fn io(self: Box<Self>, io: IoStream) -> io::Result<()>;
method io (line 76) | async fn io(self: Box<Self>, _: IoStream) -> io::Result<()> {
type AsyncReadWrite (line 89) | pub trait AsyncReadWrite: AsyncRead + AsyncWrite + Unpin { }
method poll_read (line 111) | fn poll_read(
method poll_write (line 121) | fn poll_write(
method poll_flush (line 129) | fn poll_flush(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io::Re...
method poll_shutdown (line 133) | fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io:...
method poll_write_vectored (line 137) | fn poll_write_vectored(
method is_write_vectored (line 145) | fn is_write_vectored(&self) -> bool {
function is_unpin (line 155) | fn is_unpin() {
FILE: core/lib/src/data/limits.rs
type Limits (line 124) | pub struct Limits {
constant FORM (line 145) | pub const FORM: ByteUnit = ByteUnit::Kibibyte(32);
constant DATA_FORM (line 148) | pub const DATA_FORM: ByteUnit = ByteUnit::Mebibyte(2);
constant FILE (line 151) | pub const FILE: ByteUnit = ByteUnit::Mebibyte(1);
constant STRING (line 154) | pub const STRING: ByteUnit = ByteUnit::Kibibyte(8);
constant BYTES (line 157) | pub const BYTES: ByteUnit = ByteUnit::Kibibyte(8);
constant JSON (line 160) | pub const JSON: ByteUnit = ByteUnit::Mebibyte(1);
constant MESSAGE_PACK (line 163) | pub const MESSAGE_PACK: ByteUnit = ByteUnit::Mebibyte(1);
method new (line 179) | pub fn new() -> Self {
method limit (line 203) | pub fn limit<S: Into<Uncased<'static>>>(mut self, name: S, limit: Byte...
method get (line 238) | pub fn get<S: AsRef<str>>(&self, name: S) -> Option<ByteUnit> {
method find (line 285) | pub fn find<S: AsRef<str>, L: AsRef<[S]>>(&self, layers: L) -> Option<...
method deserialize (line 306) | fn deserialize<'de, D>(de: D) -> Result<Vec<(Uncased<'static>, ByteUni...
method default (line 131) | fn default() -> Limits {
type Error (line 317) | type Error = std::convert::Infallible;
function from_request (line 319) | async fn from_request(req: &'r Request<'_>) -> Outcome<Self, Self::Error> {
FILE: core/lib/src/data/peekable.rs
type Peekable (line 3) | pub struct Peekable<const N: usize, R> {
function new (line 10) | pub fn new(reader: R) -> Self {
function with_buffer (line 14) | pub fn with_buffer(buffer: Vec<u8>, complete: bool, reader: R) -> Self {
function peek (line 18) | pub async fn peek(&mut self, num: usize) -> &[u8] {
FILE: core/lib/src/data/transform.rs
type Transform (line 38) | pub trait Transform {
method transform (line 46) | fn transform(
method poll_finish (line 59) | fn poll_finish(
method transform (line 140) | fn transform(mut self: Pin<&mut Self>, buf: &mut TransformBuf<'_, '_>)...
method transform (line 151) | fn transform(mut self: Pin<&mut Self>, buf: &mut TransformBuf<'_, '_>,...
method transform (line 205) | fn transform(
method poll_finish (line 214) | fn poll_finish(
type TransformBuf (line 110) | pub struct TransformBuf<'a, 'b> {
function fresh (line 117) | pub fn fresh(&self) -> &[u8] {
function fresh_mut (line 123) | pub fn fresh_mut(&mut self) -> &mut [u8] {
function spoil (line 131) | pub fn spoil(&mut self) {
type Inspect (line 137) | pub struct Inspect(pub(crate) Box<dyn FnMut(&[u8]) + Send + Sync + 'stat...
type InPlaceMap (line 146) | pub struct InPlaceMap(
type Target (line 157) | type Target = ReadBuf<'b>;
method deref (line 159) | fn deref(&self) -> &Self::Target {
method deref_mut (line 165) | fn deref_mut(&mut self) -> &mut Self::Target {
type HashTransform (line 199) | pub struct HashTransform<H: Hasher> {
function chain_hash_transform (line 231) | pub fn chain_hash_transform<H: std::hash::Hasher>(&mut self, hasher: H) ...
function test_transform_series (line 240) | fn test_transform_series() {
FILE: core/lib/src/erased.rs
type ErasedRequest (line 26) | pub struct ErasedRequest {
method new (line 59) | pub fn new(
method inner (line 80) | pub fn inner(&self) -> &Request<'_> {
method into_response (line 85) | pub async fn into_response<T, D>(
method drop (line 34) | fn drop(&mut self) { }
type ErasedResponse (line 38) | pub struct ErasedResponse {
method inner (line 130) | pub fn inner(&self) -> &Response<'_> {
method with_inner_mut (line 135) | pub fn with_inner_mut<'a, T>(
method make_io_handler (line 143) | pub fn make_io_handler<'a, T: 'static>(
method drop (line 45) | fn drop(&mut self) { }
type ErasedIoHandler (line 48) | pub struct ErasedIoHandler {
method with_inner_mut (line 163) | pub fn with_inner_mut<'a, T: 'a>(
method take (line 174) | pub fn take<'a>(&'a mut self) -> Box<dyn IoHandler + 'a> {
method drop (line 55) | fn drop(&mut self) { }
method poll_read (line 184) | fn poll_read(
FILE: core/lib/src/error.rs
type Error (line 44) | pub struct Error {
method new (line 148) | pub(crate) fn new(kind: ErrorKind) -> Error {
method kind (line 172) | pub fn kind(&self) -> &ErrorKind {
method report (line 194) | pub fn report<P: Phase>(result: Result<Rocket<P>, Error>) -> process::...
method from (line 206) | fn from(kind: ErrorKind) -> Self {
method from (line 212) | fn from(e: figment::Error) -> Self {
method from (line 218) | fn from(e: io::Error) -> Self {
method fmt (line 258) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method fmt (line 265) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type ErrorKind (line 57) | pub enum ErrorKind {
method fmt (line 241) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type Empty (line 90) | pub struct Empty;
method fmt (line 271) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method fmt (line 277) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type InvalidOption (line 124) | pub struct InvalidOption<'a> {
function new (line 133) | pub fn new(value: &'a str, options: &'static [&'static str]) -> Self {
function fmt (line 139) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method source (line 224) | fn source(&self) -> Option<&(dyn StdError + 'static)> {
type ServerError (line 284) | struct ServerError<'a>(&'a (dyn StdError + 'static));
function fmt (line 287) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
function log_server_error (line 311) | pub(crate) fn log_server_error(error: &(dyn StdError + 'static)) {
type DisplayHack (line 346) | pub struct DisplayHack<T: ?Sized>(pub T);
type DefaultDisplay (line 348) | pub trait DefaultDisplay {
method display (line 349) | fn display(&self) -> impl fmt::Display;
method display (line 356) | fn display(&self) -> impl fmt::Display {
function display (line 365) | pub fn display(&self) -> impl fmt::Display + '_ {
FILE: core/lib/src/fairing/ad_hoc.rs
type AdHoc (line 39) | pub struct AdHoc {
method on_ignite (line 92) | pub fn on_ignite<F, Fut>(name: &'static str, f: F) -> AdHoc
method try_on_ignite (line 113) | pub fn try_on_ignite<F, Fut>(name: &'static str, f: F) -> AdHoc
method on_liftoff (line 133) | pub fn on_liftoff<F: Send + Sync + 'static>(name: &'static str, f: F) ...
method on_request (line 156) | pub fn on_request<F: Send + Sync + 'static>(name: &'static str, f: F) ...
method on_response (line 182) | pub fn on_response<F: Send + Sync + 'static>(name: &'static str, f: F)...
method on_shutdown (line 203) | pub fn on_shutdown<F: Send + Sync + 'static>(name: &'static str, f: F)...
method config (line 232) | pub fn config<'de, T>() -> AdHoc
method uri_normalizer (line 315) | pub fn uri_normalizer() -> impl Fairing {
type Once (line 44) | struct Once<F: ?Sized>(Mutex<Option<Box<F>>>);
function new (line 47) | fn new(f: Box<F>) -> Self { Once(Mutex::new(Some(f))) }
function take (line 50) | fn take(&self) -> Box<F> {
type AdHocKind (line 55) | enum AdHocKind {
method info (line 405) | fn info(&self) -> Info {
method on_ignite (line 417) | async fn on_ignite(&self, rocket: Rocket<Build>) -> Result {
method on_liftoff (line 424) | async fn on_liftoff(&self, rocket: &Rocket<Orbit>) {
method on_request (line 430) | async fn on_request(&self, req: &mut Request<'_>, data: &mut Data<'_>) {
method on_response (line 436) | async fn on_response<'r>(&self, req: &'r Request<'_>, res: &mut Response...
method on_shutdown (line 442) | async fn on_shutdown(&self, rocket: &Rocket<Orbit>) {
FILE: core/lib/src/fairing/fairings.rs
type Fairings (line 5) | pub struct Fairings {
method new (line 37) | pub fn new() -> Fairings {
method active (line 41) | pub fn active(&self) -> impl Iterator<Item = &usize> {
method unique_active (line 49) | pub fn unique_active(&self) -> impl Iterator<Item = usize> {
method unique_set (line 60) | pub fn unique_set(&self) -> Vec<&dyn Fairing> {
method add (line 64) | pub fn add(&mut self, fairing: Box<dyn Fairing>) {
method append (line 119) | pub fn append(&mut self, others: &mut Fairings) {
method handle_ignite (line 125) | pub async fn handle_ignite(mut rocket: Rocket<Build>) -> Rocket<Build> {
method handle_liftoff (line 152) | pub async fn handle_liftoff(&self, rocket: &Rocket<Orbit>) {
method handle_request (line 158) | pub async fn handle_request(&self, req: &mut Request<'_>, data: &mut D...
method handle_response (line 165) | pub async fn handle_response<'r>(&self, req: &'r Request<'_>, res: &mu...
method handle_shutdown (line 172) | pub async fn handle_shutdown(&self, rocket: &Rocket<Orbit>) {
method audit (line 177) | pub fn audit(&self) -> Result<(), &[Info]> {
method filter (line 184) | pub fn filter<F: Fairing>(&self) -> impl Iterator<Item = &F> {
method filter_mut (line 189) | pub fn filter_mut<F: Fairing>(&mut self) -> impl Iterator<Item = &mut ...
method fmt (line 207) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
FILE: core/lib/src/fairing/info_kind.rs
type Info (line 26) | pub struct Info {
type Kind (line 54) | pub struct Kind(usize);
constant Ignite (line 59) | pub const Ignite: Kind = Kind(1 << 0);
constant Liftoff (line 62) | pub const Liftoff: Kind = Kind(1 << 1);
constant Request (line 65) | pub const Request: Kind = Kind(1 << 2);
constant Response (line 68) | pub const Response: Kind = Kind(1 << 3);
constant Shutdown (line 71) | pub const Shutdown: Kind = Kind(1 << 4);
constant Singleton (line 75) | pub const Singleton: Kind = Kind(1 << 5);
method is (line 97) | pub fn is(self, other: Kind) -> bool {
method is_exactly (line 117) | pub fn is_exactly(self, other: Kind) -> bool {
method fmt (line 132) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
type Output (line 123) | type Output = Self;
method bitor (line 126) | fn bitor(self, rhs: Self) -> Self {
FILE: core/lib/src/fairing/mod.rs
type Result (line 65) | pub type Result<T = Rocket<Build>, E = Rocket<Build>> = std::result::Res...
type Fairing (line 428) | pub trait Fairing: Send + Sync + AsAny + 'static {
method info (line 462) | fn info(&self) -> Info;
method on_ignite (line 477) | async fn on_ignite(&self, rocket: Rocket<Build>) -> Result { Ok(rocket) }
method on_liftoff (line 490) | async fn on_liftoff(&self, _rocket: &Rocket<Orbit>) { }
method on_request (line 504) | async fn on_request(&self, _req: &mut Request<'_>, _data: &mut Data<'_...
method on_response (line 518) | async fn on_response<'r>(&self, _req: &'r Request<'_>, _res: &mut Resp...
method on_shutdown (line 533) | async fn on_shutdown(&self, _rocket: &Rocket<Orbit>) { }
method info (line 544) | fn info(&self) -> Info {
method on_ignite (line 549) | async fn on_ignite(&self, rocket: Rocket<Build>) -> Result {
method on_liftoff (line 554) | async fn on_liftoff(&self, rocket: &Rocket<Orbit>) {
method on_request (line 559) | async fn on_request(&self, req: &mut Request<'_>, data: &mut Data<'_>) {
method on_response (line 564) | async fn on_response<'r>(&self, req: &'r Request<'_>, res: &mut Respon...
method on_shutdown (line 569) | async fn on_shutdown(&self, rocket: &Rocket<Orbit>) {
type AsAny (line 536) | pub trait AsAny: Any {
method as_any_ref (line 537) | fn as_any_ref(&self) -> &dyn Any;
method as_any_mut (line 538) | fn as_any_mut(&mut self) -> &mut dyn Any;
method as_any_ref (line 575) | fn as_any_ref(&self) -> &dyn Any { self }
method as_any_mut (line 576) | fn as_any_mut(&mut self) -> &mut dyn Any { self }
function downcast_ref (line 580) | fn downcast_ref<T: Any>(&self) -> Option<&T> {
function downcast_mut (line 584) | fn downcast_mut<T: Any>(&mut self) -> Option<&mut T> {
FILE: core/lib/src/form/buffer.rs
type Shareable (line 17) | pub unsafe trait Shareable: std::ops::Deref + Sync + Send + 'static {
method size (line 19) | fn size(&self) -> usize;
method size (line 23) | fn size(&self) -> usize { self.len() }
method size (line 27) | fn size(&self) -> usize { self.len() }
type SharedStack (line 36) | pub struct SharedStack<T: Shareable> {
function new (line 46) | pub fn new() -> Self {
function push (line 55) | pub(crate) fn push<S: Into<T>>(&self, string: S) -> &T::Target {
function push_owned (line 87) | pub fn push_owned(&self, string: T) -> &T::Target {
function push_split (line 98) | pub(crate) fn push_split<S: Into<T>>(&self, string: S, n: usize) -> (&T:...
function push_two (line 107) | pub(crate) fn push_two<V>(&self, a: V, b: V) -> (&T::Target, &T::Target)
FILE: core/lib/src/form/context.rs
type Contextual (line 45) | pub struct Contextual<'v, T> {
type Context (line 82) | pub struct Context<'v> {
function fields (line 107) | pub fn fields(&self) -> impl Iterator<Item = &'v Name> + '_ {
function field_value (line 132) | pub fn field_value<N: AsRef<Name>>(&self, name: N) -> Option<&'v str> {
function field_values (line 155) | pub fn field_values<N>(&self, name: N) -> impl Iterator<Item = &'v str> ...
function errors (line 180) | pub fn errors(&self) -> impl Iterator<Item = &Error<'v>> {
function field_errors (line 222) | pub fn field_errors<'a, N>(&'a self, name: N) -> impl Iterator<Item = &'...
function exact_field_errors (line 270) | pub fn exact_field_errors<'a, N>(&'a self, name: N) -> impl Iterator<Ite...
function status (line 295) | pub fn status(&self) -> Status {
function push_error (line 318) | pub fn push_error(&mut self, error: Error<'v>) {
function push_errors (line 348) | pub fn push_errors<E: Into<Errors<'v>>>(&mut self, errors: E) {
function from (line 354) | fn from(errors: Errors<'f>) -> Self {
type Context (line 363) | type Context = (<T as FromForm<'v>>::Context, Context<'v>);
function init (line 365) | fn init(opts: Options) -> Self::Context {
function push_value (line 369) | fn push_value((ref mut val_ctxt, ctxt): &mut Self::Context, field: Value...
function push_data (line 374) | async fn push_data((ref mut val_ctxt, ctxt): &mut Self::Context, field: ...
function push_error (line 379) | fn push_error((_, ref mut ctxt): &mut Self::Context, e: Error<'v>) {
function finalize (line 383) | fn finalize((val_ctxt, mut context): Self::Context) -> Result<'v, Self> {
FILE: core/lib/src/form/error.rs
type Errors (line 59) | pub struct Errors<'v>(Vec<Error<'v>>);
type Error (line 135) | pub struct Error<'v> {
type ErrorKind (line 167) | pub enum ErrorKind<'v> {
type Entity (line 220) | pub enum Entity {
method fmt (line 1000) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method default_for (line 1026) | pub const fn default_for(kind: &ErrorKind<'_>) -> Self {
function new (line 250) | pub fn new() -> Self {
function with_name (line 273) | pub fn with_name<N: Into<NameBuf<'v>>>(mut self, name: N) -> Self {
function set_name (line 297) | pub fn set_name<N: Into<NameBuf<'v>>>(&mut self, name: N) {
function with_value (line 325) | pub fn with_value(mut self, value: &'v str) -> Self {
function set_value (line 349) | pub fn set_value(&mut self, value: &'v str) {
function status (line 376) | pub fn status(&self) -> Status {
type Owned (line 383) | type Owned = Errors<'static>;
function into_owned (line 385) | fn into_owned(self) -> Self::Owned {
function fmt (line 391) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type Target (line 402) | type Target = Vec<Error<'v>>;
function deref (line 404) | fn deref(&self) -> &Self::Target {
function deref_mut (line 410) | fn deref_mut(&mut self) -> &mut Self::Target {
function from (line 417) | fn from(e: T) -> Self {
function from (line 424) | fn from(v: Vec<Error<'v>>) -> Self {
type Item (line 430) | type Item = Error<'v>;
type IntoIter (line 432) | type IntoIter = <Vec<Error<'v>> as IntoIterator>::IntoIter;
method into_iter (line 434) | fn into_iter(self) -> Self::IntoIter {
function custom (line 453) | pub fn custom<E>(error: E) -> Self
function validation (line 470) | pub fn validation<S: Into<Cow<'v, str>>>(msg: S) -> Self {
function with_entity (line 488) | pub fn with_entity(mut self, entity: Entity) -> Self {
function set_entity (line 506) | pub fn set_entity(&mut self, entity: Entity) {
function with_name (line 527) | pub fn with_name<N: Into<NameBuf<'v>>>(mut self, name: N) -> Self {
function set_name (line 548) | pub fn set_name<N: Into<NameBuf<'v>>>(&mut self, name: N) {
function with_value (line 571) | pub fn with_value(mut self, value: &'v str) -> Self {
function set_value (line 592) | pub fn set_value(&mut self, value: &'v str) {
function is_for (line 630) | pub fn is_for<N: AsRef<Name>>(&self, name: N) -> bool {
function is_for_exactly (line 682) | pub fn is_for_exactly<N: AsRef<Name>>(&self, name: N) -> bool {
function status (line 724) | pub fn status(&self) -> Status {
method serialize (line 741) | fn serialize<S: Serializer>(&self, ser: S) -> Result<S::Ok, S::Error> {
type Owned (line 752) | type Owned = Error<'static>;
function into_owned (line 754) | fn into_owned(self) -> Self::Owned {
type Target (line 765) | type Target = ErrorKind<'v>;
function deref (line 767) | fn deref(&self) -> &Self::Target {
function fmt (line 773) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
function from (line 780) | fn from(k: T) -> Self {
function from (line 788) | fn from(error: multer::Error) -> Self {
function fmt (line 815) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
type Owned (line 876) | type Owned = ErrorKind<'static>;
function into_owned (line 878) | fn into_owned(self) -> Self::Owned {
function eq (line 909) | fn eq(&self, other: &ErrorKind<'b>) -> bool {
function from (line 933) | fn from((min, max): (Option<u64>, Option<u64>)) -> Self {
function from (line 939) | fn from(choices: &'static [Cow<'v, str>]) -> Self {
function from (line 945) | fn from(choices: Vec<Cow<'v, str>>) -> Self {
function from (line 951) | fn from((start, end): (Option<isize>, Option<isize>)) -> Self {
function from (line 957) | fn from((start, end): (Option<ByteUnit>, Option<ByteUnit>)) -> Self {
function from (line 963) | fn from(choices: &'static [Cow<'v, str>; N]) -> Self {
function from (line 970) | fn from(e: Box<dyn std::error::Error + Send>) -> Self {
function from (line 976) | fn from((status, e): (Status, Box<dyn std::error::Error + Send>)) -> Self {
FILE: core/lib/src/form/field.rs
type ValueField (line 12) | pub struct ValueField<'r> {
type DataField (line 25) | pub struct DataField<'r, 'i> {
function parse (line 65) | pub fn parse(field: &'v str) -> Self {
function from_value (line 87) | pub fn from_value(value: &'v str) -> Self {
function shift (line 109) | pub fn shift(mut self) -> Self {
function unexpected (line 136) | pub fn unexpected(&self) -> Error<'v> {
function missing (line 165) | pub fn missing(&self) -> Error<'v> {
function shift (line 188) | pub fn shift(mut self) -> Self {
function unexpected (line 210) | pub fn unexpected(&self) -> Error<'v> {
function from (line 218) | fn from((name, value): (&'a str, &'a str)) -> Self {
function eq (line 224) | fn eq(&self, other: &ValueField<'b>) -> bool {
FILE: core/lib/src/form/form.rs
type Form (line 132) | pub struct Form<T>(T);
function into_inner (line 161) | pub fn into_inner(self) -> T {
function from (line 168) | fn from(val: T) -> Form<T> {
function parse (line 199) | pub fn parse(string: &'r str) -> Result<'r, T> {
function parse_iter (line 230) | pub fn parse_iter<I>(fields: I) -> Result<'r, T>
function parse_encoded (line 265) | pub fn parse_encoded(string: &RawStr) -> Result<'static, T> {
function values (line 295) | pub fn values(string: &str) -> impl Iterator<Item = ValueField<'_>> {
type Target (line 304) | type Target = T;
method deref (line 306) | fn deref(&self) -> &Self::Target {
method deref_mut (line 312) | fn deref_mut(&mut self) -> &mut Self::Target {
type Error (line 319) | type Error = Errors<'r>;
function from_data (line 321) | async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> Outcome<'r, ...
FILE: core/lib/src/form/from_form.rs
type FromForm (line 532) | pub trait FromForm<'r>: Send + Sized {
method init (line 537) | fn init(opts: Options) -> Self::Context;
method push_value (line 540) | fn push_value(ctxt: &mut Self::Context, field: ValueField<'r>);
method push_data (line 543) | async fn push_data(ctxt: &mut Self::Context, field: DataField<'r, '_>);
method push_error (line 548) | fn push_error(_ctxt: &mut Self::Context, _error: Error<'r>) { }
method finalize (line 552) | fn finalize(ctxt: Self::Context) -> Result<'r, Self>;
method default (line 561) | fn default(opts: Options) -> Option<Self> {
type VecContext (line 567) | pub struct VecContext<'v, T: FromForm<'v>> {
function new (line 576) | fn new(opts: Options) -> Self {
function shift (line 586) | fn shift(&mut self) {
function context (line 595) | fn context(&mut self, name: &NameView<'v>) -> &mut T::Context {
type Context (line 614) | type Context = VecContext<'v, T>;
function init (line 616) | fn init(opts: Options) -> Self::Context {
function push_value (line 620) | fn push_value(this: &mut Self::Context, field: ValueField<'v>) {
function push_data (line 624) | async fn push_data(this: &mut Self::Context, field: DataField<'v, '_>) {
function finalize (line 628) | fn finalize(mut this: Self::Context) -> Result<'v, Self> {
type MapContext (line 643) | pub struct MapContext<'v, K, V> where K: FromForm<'v>, V: FromForm<'v> {
function new (line 659) | fn new(opts: Options) -> Self {
function ctxt (line 669) | fn ctxt(&mut self, key: &'v str, name: NameView<'v>) -> &mut (K::Context...
function push (line 682) | fn push(&mut self, name: NameView<'v>) -> Option<Either<&mut K::Context,...
function push_value (line 723) | fn push_value(&mut self, field: ValueField<'v>) {
function push_data (line 731) | async fn push_data(&mut self, field: DataField<'v, '_>) {
function finalize (line 739) | fn finalize<T: std::iter::FromIterator<(K, V)>>(mut self) -> Result<'v, ...
type Context (line 775) | type Context = MapContext<'v, K, V>;
function init (line 777) | fn init(opts: Options) -> Self::Context {
function push_value (line 781) | fn push_value(ctxt: &mut Self::Context, field: ValueField<'v>) {
function push_data (line 785) | async fn push_data(ctxt: &mut Self::Context, field: DataField<'v, '_>) {
function finalize (line 789) | fn finalize(this: Self::Context) -> Result<'v, Self> {
type Context (line 798) | type Context = MapContext<'v, K, V>;
function init (line 800) | fn init(opts: Options) -> Self::Context {
function push_value (line 804) | fn push_value(ctxt: &mut Self::Context, field: ValueField<'v>) {
function push_data (line 808) | async fn push_data(ctxt: &mut Self::Context, field: DataField<'v, '_>) {
function finalize (line 812) | fn finalize(this: Self::Context) -> Result<'v, Self> {
type Context (line 819) | type Context = <T as FromForm<'v>>::Context;
function init (line 821) | fn init(_: Options) -> Self::Context {
function push_value (line 825) | fn push_value(ctxt: &mut Self::Context, field: ValueField<'v>) {
function push_data (line 829) | async fn push_data(ctxt: &mut Self::Context, field: DataField<'v, '_>) {
function finalize (line 833) | fn finalize(this: Self::Context) -> Result<'v, Self> {
type Context (line 840) | type Context = <T as FromForm<'v>>::Context;
function init (line 842) | fn init(opts: Options) -> Self::Context {
function push_value (line 846) | fn push_value(ctxt: &mut Self::Context, field: ValueField<'v>) {
function push_data (line 850) | async fn push_data(ctxt: &mut Self::Context, field: DataField<'v, '_>) {
function finalize (line 854) | fn finalize(this: Self::Context) -> Result<'v, Self> {
type PairContext (line 860) | pub struct PairContext<'v, A: FromForm<'v>, B: FromForm<'v>> {
function context (line 867) | fn context(
type Context (line 883) | type Context = PairContext<'v, A, B>;
function init (line 885) | fn init(opts: Options) -> Self::Context {
function push_value (line 893) | fn push_value(ctxt: &mut Self::Context, field: ValueField<'v>) {
function push_data (line 901) | async fn push_data(ctxt: &mut Self::Context, field: DataField<'v, '_>) {
function finalize (line 909) | fn finalize(mut ctxt: Self::Context) -> Result<'v, Self> {
type Context (line 924) | type Context = <T as FromForm<'v>>::Context;
function init (line 926) | fn init(opts: Options) -> Self::Context {
function push_value (line 930) | fn push_value(ctxt: &mut Self::Context, field: ValueField<'v>) {
function push_data (line 934) | async fn push_data(ctxt: &mut Self::Context, field: DataField<'v, '_>) {
function finalize (line 938) | fn finalize(this: Self::Context) -> Result<'v, Self> {
FILE: core/lib/src/form/from_form_field.rs
type FromFormField (line 182) | pub trait FromFormField<'v>: Send + Sized {
method from_value (line 187) | fn from_value(field: ValueField<'v>) -> Result<'v, Self> {
method from_data (line 195) | async fn from_data(field: DataField<'v, '_>) -> Result<'v, Self> {
method default (line 207) | fn default() -> Option<Self> { None }
type FromFieldContext (line 211) | pub struct FromFieldContext<'v, T: FromFormField<'v>> {
function should_push (line 220) | fn should_push(&mut self) -> bool {
function push (line 225) | fn push(&mut self, name: NameView<'v>, result: Result<'v, T>) {
type Context (line 240) | type Context = FromFieldContext<'v, T>;
method init (line 242) | fn init(opts: Options) -> Self::Context {
method push_value (line 252) | fn push_value(ctxt: &mut Self::Context, field: ValueField<'v>) {
method push_data (line 259) | async fn push_data(ctxt: &mut FromFieldContext<'v, T>, field: DataField<...
method finalize (line 265) | fn finalize(ctxt: Self::Context) -> Result<'v, Self> {
function from_value (line 291) | fn from_value(field: ValueField<'v>) -> Result<'v, Self> {
function from_data (line 295) | async fn from_data(f: DataField<'v, '_>) -> Result<'v, Self> {
function from_value (line 312) | fn from_value(field: ValueField<'v>) -> Result<'v, Self> {
function from_data (line 316) | async fn from_data(f: DataField<'v, '_>) -> Result<'v, Self> {
function default (line 332) | fn default() -> Option<Self> {
function from_value (line 336) | fn from_value(field: ValueField<'v>) -> Result<'v, Self> {
function from_value (line 348) | fn from_value(field: ValueField<'v>) -> Result<'v, Self> {
function from_data (line 352) | async fn from_data(f: DataField<'v, '_>) -> Result<'v, Self> {
function from_value (line 369) | fn from_value(field: ValueField<'v>) -> Result<'v, Self> {
function from_data (line 374) | async fn from_data(field: DataField<'v, '_>) -> Result<'v, Self> {
method from_value (line 413) | fn from_value(field: ValueField<'v>) -> Result<'v, Self> {
method from_value (line 422) | fn from_value(field: ValueField<'v>) -> Result<'v, Self> {
method from_value (line 432) | fn from_value(field: ValueField<'v>) -> Result<'v, Self> {
FILE: core/lib/src/form/lenient.rs
type Lenient (line 42) | pub struct Lenient<T>(T);
function into_inner (line 71) | pub fn into_inner(self) -> T {
type Context (line 78) | type Context = T::Context;
function init (line 81) | fn init(_: Options) -> Self::Context {
function push_value (line 86) | fn push_value(ctxt: &mut Self::Context, field: ValueField<'v>) {
function push_data (line 91) | async fn push_data(ctxt: &mut Self::Context, field: DataField<'v, '_>) {
function finalize (line 96) | fn finalize(this: Self::Context) -> Result<'v, Self> {
type Target (line 102) | type Target = T;
method deref (line 104) | fn deref(&self) -> &Self::Target {
method deref_mut (line 110) | fn deref_mut(&mut self) -> &mut Self::Target {
function from (line 117) | fn from(val: T) -> Lenient<T> {
type Target (line 123) | type Target = T::Target;
function from_uri_param (line 126) | fn from_uri_param(param: A) -> Self::Target {
FILE: core/lib/src/form/mod.rs
type Result (line 382) | pub type Result<'v, T> = std::result::Result<T, Errors<'v>>;
FILE: core/lib/src/form/name/buf.rs
type NameBuf (line 20) | pub struct NameBuf<'v> {
function split (line 27) | fn split(&self) -> (&Name, &Name) {
function keys (line 45) | pub fn keys(&self) -> impl Iterator<Item = &Key> {
function is_empty (line 64) | pub fn is_empty(&self) -> bool {
type Owned (line 71) | type Owned = NameBuf<'static>;
function into_owned (line 73) | fn into_owned(self) -> Self::Owned {
function serialize (line 86) | fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
function from (line 94) | fn from(nv: NameView<'v>) -> Self {
function from (line 100) | fn from(name: &'v Name) -> Self {
function from (line 106) | fn from(name: &'v str) -> Self {
function from (line 112) | fn from(name: String) -> Self {
function from (line 119) | fn from((prefix, right): (Option<&'v Name>, Cow<'v, str>)) -> Self {
function from (line 129) | fn from((prefix, right): (Option<&'v Name>, String)) -> Self {
function from (line 139) | fn from((prefix, suffix): (Option<&'v Name>, &'v str)) -> Self {
function from (line 146) | fn from((prefix, suffix): (&'v Name, &'v str)) -> Self {
function fmt (line 152) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
function fmt (line 167) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
method eq (line 180) | fn eq(&self, other: &Self) -> bool {
function eq (line 186) | fn eq(&self, other: &N) -> bool {
method eq (line 192) | fn eq(&self, other: &NameBuf<'_>) -> bool {
function eq (line 198) | fn eq(&self, other: &NameBuf<'_>) -> bool {
function eq (line 204) | fn eq(&self, other: &NameBuf<'_>) -> bool {
function hash (line 212) | fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
function equivalent (line 218) | fn equivalent(&self, key: &Name) -> bool {
method equivalent (line 224) | fn equivalent(&self, key: &NameBuf<'_>) -> bool {
FILE: core/lib/src/form/name/key.rs
type Key (line 29) | pub struct Key(str);
method new (line 42) | pub fn new<S: AsRef<str> + ?Sized>(string: &S) -> &Key {
method indices (line 59) | pub fn indices(&self) -> impl Iterator<Item = &str> {
method as_str (line 73) | pub fn as_str(&self) -> &str {
method serialize (line 87) | fn serialize<S>(&self, ser: S) -> Result<S::Ok, S::Error>
type Output (line 103) | type Output = Key;
method index (line 106) | fn index(&self, index: I) -> &Self::Output {
method eq (line 112) | fn eq(&self, other: &str) -> bool {
method fmt (line 143) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
type Target (line 79) | type Target = str;
method deref (line 81) | fn deref(&self) -> &Self::Target {
function deserialize (line 95) | fn deserialize<D>(de: D) -> Result<Self, D::Error>
function eq (line 118) | fn eq(&self, other: &Key) -> bool {
function from (line 125) | fn from(string: &'a S) -> Self {
function as_ref (line 131) | fn as_ref(&self) -> &Key {
method as_ref (line 137) | fn as_ref(&self) -> &Key {
FILE: core/lib/src/form/name/name.rs
type Name (line 30) | pub struct Name(str);
method new (line 43) | pub fn new<S: AsRef<str> + ?Sized>(string: &S) -> &Name {
method keys (line 60) | pub fn keys(&self) -> impl Iterator<Item = &Key> {
method prefixes (line 96) | pub fn prefixes(&self) -> impl Iterator<Item = &Name> {
method as_str (line 126) | pub fn as_str(&self) -> &str {
method serialize (line 132) | fn serialize<S>(&self, ser: S) -> Result<S::Ok, S::Error>
type Output (line 163) | type Output = Name;
method index (line 166) | fn index(&self, index: I) -> &Self::Output {
method eq (line 178) | fn eq(&self, other: &str) -> bool {
method eq (line 190) | fn eq(&self, other: &&str) -> bool {
method as_ref (line 214) | fn as_ref(&self) -> &Name {
method hash (line 222) | fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
method fmt (line 228) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
method fmt (line 234) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
function deserialize (line 140) | fn deserialize<D>(de: D) -> Result<Self, D::Error>
function from (line 149) | fn from(string: &'a S) -> Self {
type Target (line 155) | type Target = str;
method deref (line 157) | fn deref(&self) -> &Self::Target {
method eq (line 172) | fn eq(&self, other: &Self) -> bool {
function eq (line 184) | fn eq(&self, other: &Name) -> bool {
function eq (line 196) | fn eq(&self, other: &Name) -> bool {
function as_ref (line 202) | fn as_ref(&self) -> &Name {
method as_ref (line 208) | fn as_ref(&self) -> &Name {
FILE: core/lib/src/form/name/view.rs
type NameView (line 79) | pub struct NameView<'v> {
function new (line 98) | pub fn new<N: Into<&'v Name>>(name: N) -> Self {
function shift (line 156) | pub fn shift(&mut self) {
function key (line 210) | pub fn key(&self) -> Option<&'v Key> {
function key_lossy (line 244) | pub fn key_lossy(&self) -> &'v Key {
function as_name (line 271) | pub fn as_name(&self) -> &'v Name {
function parent (line 293) | pub fn parent(&self) -> Option<&'v Name> {
function source (line 320) | pub fn source(&self) -> &'v Name {
function is_at_last (line 325) | fn is_at_last(&self) -> bool {
function exhausted (line 330) | pub(crate) fn exhausted(&self) -> bool {
function fmt (line 336) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
function fmt (line 342) | fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
function eq (line 348) | fn eq(&self, other: &NameView<'b>) -> bool {
function eq (line 354) | fn eq(&self, other: &B) -> bool {
function hash (line 362) | fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
function borrow (line 368) | fn borrow(&self) -> &Name {
FILE: core/lib/src/form/options.rs
type Options (line 5) | pub struct Options {
constant Lenient (line 13) | pub const Lenient: Self = Options { strict: false };
constant Strict (line 16) | pub const Strict: Self = Options { strict: true };
FILE: core/lib/src/form/parser.rs
type Result (line 9) | type Result<'r, T> = std::result::Result<T, Error<'r>>;
type Field (line 11) | type Field<'r, 'i> = Either<ValueField<'r>, DataField<'r, 'i>>;
type MultipartParser (line 13) | pub struct MultipartParser<'r, 'i> {
type RawStrParser (line 20) | pub struct RawStrParser<'r> {
type Parser (line 25) | pub enum Parser<'r, 'i> {
function new (line 31) | pub async fn new(
function from_form (line 47) | async fn from_form(req: &'r Request<'i>, data: Data<'r>) -> Result<'r, P...
function from_multipart (line 60) | async fn from_multipart(req: &'r Request<'i>, data: Data<'r>) -> Result<...
function next (line 85) | pub async fn next(&mut self) -> Option<Result<'r, Field<'r, 'i>>> {
function new (line 94) | pub fn new(buffer: &'r SharedStack<String>, source: &'r RawStr) -> Self {
type Item (line 100) | type Item = ValueField<'r>;
method next (line 102) | fn next(&mut self) -> Option<Self::Item> {
function test_skips_empty (line 139) | fn test_skips_empty() {
function test_decodes (line 146) | fn test_decodes() {
function next (line 156) | async fn next(&mut self) -> Option<Result<'r, Field<'r, 'i>>> {
FILE: core/lib/src/form/strict.rs
type Strict (line 57) | pub struct Strict<T>(T);
function into_inner (line 86) | pub fn into_inner(self) -> T {
type Context (line 93) | type Context = T::Context;
function init (line 96) | fn init(_: Options) -> Self::Context {
function push_value (line 101) | fn push_value(ctxt: &mut Self::Context, field: ValueField<'v>) {
function push_data (line 106) | async fn push_data(ctxt: &mut Self::Context, field: DataField<'v, '_>) {
function finalize (line 111) | fn finalize(this: Self::Context) -> Result<'v, Self> {
type Target (line 117) | type Target = T;
method deref (line 119) | fn deref(&self) -> &Self::Target {
method deref_mut (line 125) | fn deref_mut(&mut self) -> &mut Self::Target {
function from (line 132) | fn from(val: T) -> Strict<T> {
type Target (line 138) | type Target = T::Target;
function from_uri_param (line 141) | fn from_uri_param(param: A) -> Self::Target {
FILE: core/lib/src/form/tests.rs
function parse (line 5) | fn parse<'v, T: FromForm<'v>>(values: &[&'v str]) -> Result<'v, T> {
function time (line 66) | fn time() {
function bool (line 80) | fn bool() {
function defaults (line 96) | fn defaults() {
function potpourri (line 123) | fn potpourri() {
FILE: core/lib/src/form/validate.rs
function eq (line 189) | pub fn eq<'v, A, B>(a: &A, b: B) -> Result<'v, ()>
function dbg_eq (line 226) | pub fn dbg_eq<'v, A, B>(a: &A, b: B) -> Result<'v, ()>
function neq (line 266) | pub fn neq<'v, A, B>(a: &A, b: B) -> Result<'v, ()>
type Len (line 290) | pub trait Len<L> {
method len (line 292) | fn len(&self) -> L;
method len_into_u64 (line 295) | fn len_into_u64(len: L) -> u64;
method zero_len (line 298) | fn zero_len() -> L;
function len (line 319) | fn len(&self) -> ByteUnit { self.len().into() }
function len_into_u64 (line 320) | fn len_into_u64(len: ByteUnit) -> u64 { len.into() }
function zero_len (line 321) | fn zero_len() -> ByteUnit { ByteUnit::from(0) }
function len (line 325) | fn len(&self) -> L { <T as Len<L>>::len(self) }
function len_into_u64 (line 326) | fn len_into_u64(len: L) -> u64 { T::len_into_u64(len) }
function zero_len (line 327) | fn zero_len() -> L { T::zero_len() }
function len (line 331) | fn len(&self) -> L { self.as_ref().map(|v| v.len()).unwrap_or_else(T::ze...
function len_into_u64 (line 332) | fn len_into_u64(len: L) -> u64 { T::len_into_u64(len) }
function zero_len (line 333) | fn zero_len() -> L { T::zero_len() }
function len (line 337) | fn len(&self) -> L { self.value.len() }
function len_into_u64 (line 338) | fn len_into_u64(len: L) -> u64 { T::len_into_u64(len) }
function zero_len (line 339) | fn zero_len() -> L { T::zero_len() }
function len (line 343) | fn len(&self) -> L { self.as_ref().ok().len() }
function len_into_u64 (line 344) | fn len_into_u64(len: L) -> u64 { T::len_into_u64(len) }
function zero_len (line 345) | fn zero_len() -> L { T::zero_len() }
function len (line 350) | fn len(&self) -> L { self.0.len() }
function len_into_u64 (line 351) | fn len_into_u64(len: L) -> u64 { T::len_into_u64(len) }
function zero_len (line 352) | fn zero_len() -> L { T::zero_len() }
function len (line 357) | fn len(&self) -> L { self.0.len() }
function len_into_u64 (line 358) | fn len_into_u64(len: L) -> u64 { T::len_into_u64(len) }
function zero_len (line 359) | fn zero_len() -> L { T::zero_len() }
function len (line 396) | pub fn len<'v, V, L, R>(value: V, range: R) -> Result<'v, ()>
type Contains (line 432) | pub trait Contains<I> {
method contains (line 434) | fn contains(&self, item: I) -> bool;
function coerce (line 451) | fn coerce<T, const N: usize>(slice: &[T; N]) -> &[T] {
function contains (line 466) | fn contains(&self, f: F) -> bool {
method contains (line 472) | fn contains(&self, f: F) -> bool {
function contains (line 478) | fn contains(&self, item: T) -> bool {
function contains (line 484) | fn contains(&self, item: I) -> bool {
function contains (line 490) | fn contains(&self, item: I) -> bool {
function contains (line 496) | fn contains(&self, item: I) -> bool {
function contains (line 537) | pub fn contains<'v, V, I>(value: V, item: I) -> Result<'v, ()>
function dbg_contains (line 576) | pub fn dbg_contains<'v, V, I>(value: V, item: I) -> Result<'v, ()>
function omits (line 619) | pub fn omits<'v, V, I>(value: V, item: I) -> Result<'v, ()>
function dbg_omits (line 660) | pub fn dbg_omits<'v, V, I>(value: V, item: I) -> Result<'v, ()>
function range (line 690) | pub fn range<'v, V, R>(value: &V, range: R) -> Result<'v, ()>
function one_of (line 742) | pub fn one_of<'v, V, I, R>(value: V, items: R) -> Result<'v, ()>
function ext (line 790) | pub fn ext<'v>(file: &TempFile<'_>, r#type: ContentType) -> Result<'v, (...
function with (line 847) | pub fn with<'v, V, F, M>(value: V, f: F, msg: M) -> Result<'v, ()>
function try_with (line 886) | pub fn try_with<'v, V, F, T, E>(value: V, f: F) -> Result<'v, ()>
FILE: core/lib/src/fs/file_name.rs
type FileName (line 29) | pub struct FileName(str);
method new (line 45) | pub fn new<S: AsRef<str> + ?Sized>(string: &S) -> &FileName {
method as_str (line 112) | pub fn as_str(&self) -> Option<&str> {
method is_safe (line 191) | pub fn is_safe(&self) -> bool {
method dangerous_unsafe_unsanitized_raw (line 234) | pub fn dangerous_unsafe_unsanitized_raw(&self) -> &RawStr {
function from (line 241) | fn from(string: &'a S) -> Self {
FILE: core/lib/src/fs/named_file.rs
type NamedFile (line 40) | pub struct NamedFile(PathBuf, File);
method open (line 62) | pub async fn open<P: AsRef<Path>>(path: P) -> io::Result<NamedFile> {
method open_with (line 71) | pub async fn open_with<P: AsRef<Path>>(path: P, opts: &OpenOptions) ->...
method file (line 90) | pub fn file(&self) -> &File {
method file_mut (line 108) | pub fn file_mut(&mut self) -> &mut File {
method take_file (line 126) | pub fn take_file(self) -> File {
method path (line 144) | pub fn path(&self) -> &Path {
method respond_to (line 155) | fn respond_to(self, req: &'r Request<'_>) -> response::Result<'static> {
type Target (line 168) | type Target = File;
method deref (line 170) | fn deref(&self) -> &File {
method deref_mut (line 176) | fn deref_mut(&mut self) -> &mut File {
FILE: core/lib/src/fs/rewrite.rs
type Rewriter (line 22) | pub trait Rewriter: Send + Sync + 'static {
method rewrite (line 24) | fn rewrite<'r>(&self, opt: Option<Rewrite<'r>>, req: &'r Request<'_>) ...
method rewrite (line 134) | fn rewrite<'r>(&self, opt: Option<Rewrite<'r>>, _: &Request<'_>) -> Op...
method rewrite (line 143) | fn rewrite<'r>(&self, _: Option<Rewrite<'r>>, _: &Request<'_>) -> Opti...
method rewrite (line 165) | fn rewrite<'r>(&self, opt: Option<Rewrite<'r>>, req: &Request<'_>) -> ...
method rewrite (line 210) | fn rewrite<'r>(&self, opt: Option<Rewrite<'r>>, _: &Request<'_>) -> Op...
method rewrite (line 240) | fn rewrite<'r>(&self, f: Option<Rewrite<'r>>, r: &Request<'_>) -> Opti...
method rewrite (line 246) | fn rewrite<'r>(&self, _: Option<Rewrite<'r>>, _: &Request<'_>) -> Opti...
method rewrite (line 252) | fn rewrite<'r>(&self, _: Option<Rewrite<'r>>, _: &Request<'_>) -> Opti...
method rewrite (line 258) | fn rewrite<'r>(&self, _: Option<Rewrite<'r>>, _: &Request<'_>) -> Opti...
type Rewrite (line 30) | pub enum Rewrite<'r> {
type File (line 40) | pub struct File<'r> {
function new (line 49) | pub fn new(path: impl Into<Cow<'r, Path>>) -> Self {
function checked (line 58) | pub fn checked<P: AsRef<Path>>(path: P) -> Self {
function map_path (line 71) | pub fn map_path<F, P>(self, f: F) -> Self
function is_hidden (line 88) | pub fn is_hidden(&self) -> bool {
function is_visible (line 94) | pub fn is_visible(&self) -> bool {
type Prefix (line 111) | pub struct Prefix(PathBuf);
method checked (line 115) | pub fn checked<P: AsRef<Path>>(path: P) -> Self {
method unchecked (line 128) | pub fn unchecked<P: AsRef<Path>>(path: P) -> Self {
type TrailingDirs (line 162) | pub struct TrailingDirs;
type DirIndex (line 192) | pub struct DirIndex {
method unconditional (line 199) | pub fn unconditional(path: impl AsRef<Path>) -> Self {
method if_exists (line 204) | pub fn if_exists(path: impl AsRef<Path>) -> Self {
function from (line 226) | fn from(value: File<'r>) -> Self {
function from (line 232) | fn from(value: Redirect) -> Self {
FILE: core/lib/src/fs/server.rs
type FileServer (line 85) | pub struct FileServer {
constant DEFAULT_RANK (line 92) | const DEFAULT_RANK: isize = 10;
method new (line 123) | pub fn new<P: AsRef<Path>>(path: P) -> Self {
method without_index (line 160) | pub fn without_index<P: AsRef<Path>>(path: P) -> Self {
method identity (line 196) | pub fn identity() -> Self {
method rank (line 213) | pub fn rank(mut self, rank: isize) -> Self {
method rewrite (line 242) | pub fn rewrite<R: Rewriter>(mut self, rewriter: R) -> Self {
method filter (line 268) | pub fn filter<F: Send + Sync + 'static>(self, f: F) -> Self
method map (line 308) | pub fn map<F: Send + Sync + 'static>(self, f: F) -> Self
method fmt (line 359) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
function from (line 329) | fn from(server: FileServer) -> Self {
method handle (line 338) | async fn handle<'r>(&self, req: &'r Request<'_>, data: Data<'r>) -> Outc...
function open (line 368) | async fn open(self) -> std::io::Result<NamedFile<'r>> {
type NamedFile (line 384) | struct NamedFile<'r> {
function respond_to (line 393) | fn respond_to(self, _: &'r Request<'_>) -> response::Result<'r> {
FILE: core/lib/src/fs/temp_file.rs
type TempFile (line 103) | pub enum TempFile<'v> {
function persist_to (line 166) | pub async fn persist_to<P>(&mut self, path: P) -> io::Result<()>
function copy_to (line 238) | pub async fn copy_to<P>(&mut self, path: P) -> io::Result<()>
function move_copy_to (line 302) | pub async fn move_copy_to<P>(&mut self, path: P) -> io::Result<()>
function open (line 340) | pub async fn open(&self) -> io::Result<impl AsyncBufRead + '_> {
function is_empty (line 376) | pub fn is_empty(&self) -> bool {
function len (line 393) | pub fn len(&self) -> u64 {
function path (line 424) | pub fn path(&self) -> Option<&Path> {
function name (line 462) | pub fn name(&self) -> Option<&str> {
function raw_name (line 477) | pub fn raw_name(&self) -> Option<&FileName> {
function content_type (line 499) | pub fn content_type(&self) -> Option<&ContentType> {
function from (line 506) | async fn from<'a>(
function from_value (line 540) | fn from_value(field: ValueField<'v>) -> Result<Self, Errors<'v>> {
function from_data (line 545) | async fn from_data(
type Error (line 554) | type Error = io::Error;
function from_data (line 556) | async fn from_data(req: &'r Request<'_>, data: Data<'r>) -> data::Outcom...
FILE: core/lib/src/http/cookies.rs
type CookieJar (line 153) | pub struct CookieJar<'a> {
type CookieState (line 160) | pub(crate) struct CookieState<'a> {
type Op (line 167) | enum Op {
method cookie (line 595) | fn cookie(&self) -> &Cookie<'static> {
function new (line 173) | pub(crate) fn new(base: Option<cookie::CookieJar>, rocket: &'a Rocket<Or...
function get (line 203) | pub fn get(&self, name: &str) -> Option<&Cookie<'static>> {
function get_private (line 229) | pub fn get_private(&self, name: &str) -> Option<Cookie<'static>> {
function get_pending (line 253) | pub fn get_pending(&self, name: &str) -> Option<Cookie<'static>> {
function add (line 305) | pub fn add<C: Into<Cookie<'static>>>(&self, cookie: C) {
function add_private (line 345) | pub fn add_private<C: Into<Cookie<'static>>>(&self, cookie: C) {
function remove (line 388) | pub fn remove<C: Into<Cookie<'static>>>(&self, cookie: C) {
function remove_private (line 431) | pub fn remove_private<C: Into<Cookie<'static>>>(&self, cookie: C) {
function iter (line 456) | pub fn iter(&self) -> impl Iterator<Item=&Cookie<'static>> {
function reset_delta (line 462) | pub(crate) fn reset_delta(&self) {
function take_delta_jar (line 468) | pub(crate) fn take_delta_jar(&self) -> cookie::CookieJar {
function add_original (line 497) | pub(crate) fn add_original(&mut self, cookie: Cookie<'static>) {
function add_original_private (line 505) | pub(crate) fn add_original_private(&mut self, cookie: Cookie<'static>) {
function set_defaults (line 516) | fn set_defaults(&self, cookie: &mut Cookie<'static>) {
function set_removal_defaults (line 535) | fn set_removal_defaults(cookie: &mut Cookie<'static>) {
function set_private_defaults (line 556) | fn set_private_defaults(&self, cookie: &mut Cookie<'static>) {
function fmt (line 570) | fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
method clone (line 585) | fn clone(&self) -> Self {
FILE: core/lib/src/lib.rs
constant WORKER_PREFIX (line 212) | const WORKER_PREFIX: &str = "rocket-worker";
function build (line 216) | pub fn build() -> Rocket<Build> {
function custom (line 222) | pub fn custom<T: figment::Provider>(provider: T) -> Rocket<Build> {
function async_run (line 228) | pub fn async_run<F, R>(fut: F, workers: usize, sync: usize, force_end: b...
function async_test (line 249) | pub fn async_test<R>(fut: impl std::future::Future<Output = R>) -> R {
function async_main (line 255) | pub fn async_main<R>(fut: impl std::future::Future<Output = R> + Send) -...
function execute (line 352) | pub fn execute<R, F>(future: F) -> R
function running_within_rocket_async_rt (line 360) | fn running_within_rocket_async_rt() -> impl std::future::Future<Output =...
FILE: core/lib/src/lifecycle.rs
type RequestToken (line 12) | pub(crate) struct RequestToken;
function catch_handle (line 14) | async fn catch_handle<Fut, T, F>(name: Option<&str>, run: F) -> Option<T>
function preprocess (line 54) | pub(crate) async fn preprocess(
function dispatch (line 91) | pub(crate) async fn dispatch<'r, 's: 'r>(
function extract_io_handler (line 159) | pub(crate) fn extract_io_handler<'r>(
function route (line 197) | async fn route<'s, 'r: 's>(
function dispatch_error (line 234) | pub(crate) async fn dispatch_error<'r, 's: 'r>(
function invoke_catcher (line 270) | async fn invoke_catcher<'s, 'r: 's>(
FILE: core/lib/src/listener/bind.rs
type Bind (line 6) | pub trait Bind: Listener + 'static {
method bind (line 10) | async fn bind(rocket: &Rocket<Ignite>) -> Result<Self, Self::Error>;
method bind_endpoint (line 12) | fn bind_endpoint(to: &Rocket<Ignite>) -> Result<Endpoint, Self::Error>;
FILE: core/lib/src/listener/bounced.rs
type Bounced (line 7) | pub struct Bounced<L> {
type BouncedExt (line 11) | pub trait BouncedExt: Sized {
method bounced (line 12) | fn bounced(self) -> Bounced<Self> {
function is_recoverable (line 19) | fn is_recoverable(e: &io::Error) -> bool {
function accept_next (line 28) | pub async fn accept_next(&self) -> <Self as Listener>::Accept {
type Accept (line 43) | type Accept = L::Accept;
type Connection (line 45) | type Connection = L::Connection;
method accept (line 47) | async fn accept(&self) -> io::Result<Self::Accept> {
method connect (line 51) | async fn connect(&self, accept: Self::Accept) -> io::Result<Self::Connec...
method endpoint (line 55) | fn endpoint(&self) -> io::Result<Endpoint> {
FILE: core/lib/src/listener/cancellable.rs
type State (line 24) | enum State {
type CancellableExt (line 33) | pub trait CancellableExt: Sized {
method cancellable (line 34) | fn cancellable(self, stages: Stages) -> Cancellable<Self> {
function time_out (line 45) | fn time_out() -> io::Error {
function gone (line 49) | fn gone() -> io::Error {
function inner (line 54) | pub fn inner(&self) -> Option<&I> {
type AsyncCancel (line 59) | pub trait AsyncCancel {
method poll_cancel (line 60) | fn poll_cancel(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io:...
method poll_cancel (line 64) | fn poll_cancel(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<io:...
function poll_with (line 71) | pub fn poll_with<T>(
method poll_read (line 117) | fn poll_read(
method poll_write (line 127) | fn poll_write(
method poll_flush (line 135) | fn poll_flush(
method poll_shutdown (line 142) | fn poll_shutdown(
method poll_write_vectored (line 149) | fn poll_write_vectored(
method is_write_vectored (line 157) | fn is_write_vectored(&self) -> bool {
type Item (line 163) | type Item = I::Item;
method poll_next (line 165) | fn poll_next(self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Option<...
FILE: core/lib/src/listener/connection.rs
type Certificates (line 11) | pub struct Certificates<'r>(Cow<'r, [der::CertificateDer<'r>]>);
type Connection (line 13) | pub trait Connection: AsyncRead + AsyncWrite + Send + Unpin {
method endpoint (line 14) | fn endpoint(&self) -> io::Result<Endpoint>;
method certificates (line 24) | fn certificates(&self) -> Option<Certificates<'_>> { None }
method server_name (line 26) | fn server_name(&self) -> Option<&str> { None }
method endpoint (line 30) | fn endpoint(&self) -> io::Result<Endpoint> {
method certificates (line 37) | fn certificates(&self) -> Option<Certificates<'_>> {
f
Condensed preview — 686 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (3,672K chars).
[
{
"path": ".editorconfig",
"chars": 131,
"preview": "root = true\n\n[*.rs]\ninsert_final_newline = true\ntrim_trailing_whitespace = true\nindent_style = space\nindent_size = 4\ntab"
},
{
"path": ".gitattributes",
"chars": 136,
"preview": "* text eol=lf\n\n# Denote all files that are truly binary and should not be modified.\n*.png binary\n*.jpg binary\n*.gif bina"
},
{
"path": ".github/CODE_OF_CONDUCT.md",
"chars": 4033,
"preview": "# Rocket Community Code of Conduct\n\nLike the technical community as a whole, the Rocket project, its teams, and its\ncomm"
},
{
"path": ".github/FUNDING.yml",
"chars": 35,
"preview": "github: rwf2\nopen_collective: rwf2\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug-report.yml",
"chars": 4436,
"preview": "name: Bug Report\ndescription: Report a functionality issue that deviates from the documentation.\nlabels: [\"triage\"]\nbody"
},
{
"path": ".github/ISSUE_TEMPLATE/config.yml",
"chars": 615,
"preview": "blank_issues_enabled: true\ncontact_links:\n - name: FAQ\n url: https://rocket.rs/guide/faq/\n about: Please see our "
},
{
"path": ".github/ISSUE_TEMPLATE/doc-problem.yml",
"chars": 1831,
"preview": "name: Documentation Problem\ndescription: Report an issue with or suggest documentation.\nlabels: [\"docs\"]\nbody:\n - type:"
},
{
"path": ".github/ISSUE_TEMPLATE/feature-request.yml",
"chars": 2739,
"preview": "name: Feature Request\ndescription: Propose a change that introduces new functionality.\nlabels: [\"request\"]\nbody:\n - typ"
},
{
"path": ".github/ISSUE_TEMPLATE/suggestion.yml",
"chars": 2004,
"preview": "name: Suggestion\ndescription: Suggest a change or improvement to existing functionality.\nlabels: [\"suggestion\"]\nbody:\n "
},
{
"path": ".github/workflows/ci.yml",
"chars": 5045,
"preview": "name: CI\n\non: [push, pull_request]\n\nenv:\n CARGO_TERM_COLOR: always\n\njobs:\n test:\n name: \"${{ matrix.platform.name }"
},
{
"path": ".github/workflows/trigger.yaml",
"chars": 489,
"preview": "name: Trigger\non: [push]\njobs:\n trigger:\n name: api.rocket.rs\n runs-on: ubuntu-latest\n if: github.repository ="
},
{
"path": ".gitignore",
"chars": 531,
"preview": "# Compiled files\n*.o\n*.so\n*.rlib\n*.dll\n\n# Executables\n*.exe\n\n# Generated by Cargo\ntarget\n\n# Generated databases\ndb.sqlit"
},
{
"path": ".rustfmt.toml",
"chars": 30,
"preview": "disable_all_formatting = true\n"
},
{
"path": "CHANGELOG.md",
"chars": 109613,
"preview": "# Version 0.5.1 (May 22, 2024)\n\nThis release contains the following crate updates:\n\n - `rocket` `0.5.1`\n - `rocket_db_"
},
{
"path": "CONTRIBUTING.md",
"chars": 19349,
"preview": "# Contributing to Rocket\n\n**Please read this document before contributing!**\n\nThank you for contributing! We welcome you"
},
{
"path": "Cargo.toml",
"chars": 682,
"preview": "[workspace]\nresolver = \"2\"\nmembers = [\n \"core/lib/\",\n \"core/codegen/\",\n \"core/http/\",\n \"contrib/db_pools/codegen/\",\n"
},
{
"path": "LICENSE-APACHE",
"chars": 10834,
"preview": " Apache License\n Version 2.0, January 2004\n http"
},
{
"path": "LICENSE-MIT",
"chars": 1080,
"preview": "The MIT License (MIT)\nCopyright (c) 2016 Sergio Benitez\n\nPermission is hereby granted, free of charge, to any person obt"
},
{
"path": "README.md",
"chars": 4613,
"preview": "# Rocket\n\n[](https://github.com/rwf2/Rocket/action"
},
{
"path": "benchmarks/Cargo.toml",
"chars": 239,
"preview": "[package]\nname = \"rocket-benchmarks\"\nversion = \"0.0.0\"\nedition = \"2021\"\npublish = false\n\n[workspace]\n\n[[bench]]\nname = \""
},
{
"path": "benchmarks/src/bench.rs",
"chars": 60,
"preview": "mod routing;\n\ncriterion::criterion_main!(routing::routing);\n"
},
{
"path": "benchmarks/src/routing.rs",
"chars": 4228,
"preview": "use criterion::{criterion_group, Criterion};\n\nuse rocket::{route, config, Request, Data, Route, Config};\nuse rocket::htt"
},
{
"path": "benchmarks/static/bitwarden_rs.routes",
"chars": 8575,
"preview": "GET /attachments/<uuid>/<file..> (attachments)\nGET /alive (alive)\nGET /bwrs_static/<filename> (static_files)\nPOST /api/a"
},
{
"path": "benchmarks/static/rust-lang.routes",
"chars": 967,
"preview": "GET / (index)\nGET /<category> (category)\nGET /governance (governance)\nGET /governance/<section>/<team> [2] (team)\nGET /p"
},
{
"path": "contrib/db_pools/README.md",
"chars": 2254,
"preview": "# `db_pools` [![ci.svg]][ci] [![crates.io]][crate] [![docs.svg]][crate docs]\n\n[crates.io]: https://img.shields.io/crates"
},
{
"path": "contrib/db_pools/codegen/Cargo.toml",
"chars": 707,
"preview": "[package]\nname = \"rocket_db_pools_codegen\"\nversion = \"0.1.0\"\nauthors = [\"Sergio Benitez <sb@sergio.bz>\", \"Jeb Rosen <jeb"
},
{
"path": "contrib/db_pools/codegen/src/database.rs",
"chars": 4189,
"preview": "use proc_macro::TokenStream;\n\nuse devise::{DeriveGenerator, FromMeta, MapperBuild, Support, ValidatorBuild};\nuse devise:"
},
{
"path": "contrib/db_pools/codegen/src/lib.rs",
"chars": 2044,
"preview": "#![recursion_limit=\"256\"]\n#![warn(rust_2018_idioms)]\n\n//! # `rocket_db_pool` - Code Generation\n//!\n//! Implements the co"
},
{
"path": "contrib/db_pools/codegen/tests/ui-fail/database-syntax.rs",
"chars": 677,
"preview": "use rocket_db_pools::{deadpool_postgres, Database};\n\n#[derive(Database)]\n#[database(123)]\nstruct A(deadpool_postgres::Po"
},
{
"path": "contrib/db_pools/codegen/tests/ui-fail/database-types.rs",
"chars": 195,
"preview": "#[macro_use] extern crate rocket_db_pools;\n\nstruct Unknown;\n\n#[derive(Database)]\n#[database(\"foo\")]\nstruct A(Unknown);\n\n"
},
{
"path": "contrib/db_pools/codegen/tests/ui-fail-nightly/database-syntax.stderr",
"chars": 3754,
"preview": "error: invalid value: expected string literal\n --> tests/ui-fail-nightly/database-syntax.rs:4:12\n |\n4 | #[database(123)"
},
{
"path": "contrib/db_pools/codegen/tests/ui-fail-nightly/database-types.stderr",
"chars": 1026,
"preview": "error[E0277]: the trait bound `Unknown: Pool` is not satisfied\n --> tests/ui-fail-nightly/database-types.rs:7:10\n |\n7 |"
},
{
"path": "contrib/db_pools/codegen/tests/ui-fail-stable/database-syntax.stderr",
"chars": 3810,
"preview": "error: invalid value: expected string literal\n --> tests/ui-fail-stable/database-syntax.rs:4:12\n |\n4 | #[database(123)]"
},
{
"path": "contrib/db_pools/codegen/tests/ui-fail-stable/database-types.stderr",
"chars": 1024,
"preview": "error[E0277]: the trait bound `Unknown: Pool` is not satisfied\n --> tests/ui-fail-stable/database-types.rs:7:10\n |\n7 | "
},
{
"path": "contrib/db_pools/codegen/tests/ui-fail.rs",
"chars": 262,
"preview": "#[test]\n#[ignore]\nfn ui() {\n let path = match version_check::is_feature_flaggable() {\n Some(true) => \"ui-fail-"
},
{
"path": "contrib/db_pools/lib/Cargo.toml",
"chars": 2214,
"preview": "[package]\nname = \"rocket_db_pools\"\nversion = \"0.1.0\"\nauthors = [\"Sergio Benitez <sb@sergio.bz>\", \"Jeb Rosen <jeb@jebrose"
},
{
"path": "contrib/db_pools/lib/src/config.rs",
"chars": 4126,
"preview": "use rocket::serde::{Deserialize, Serialize};\n\n/// Base configuration for all database drivers.\n///\n/// A dictionary matc"
},
{
"path": "contrib/db_pools/lib/src/database.rs",
"chars": 10494,
"preview": "use std::marker::PhantomData;\nuse std::ops::{Deref, DerefMut};\n\nuse rocket::{error, Build, Ignite, Phase, Rocket, Sentin"
},
{
"path": "contrib/db_pools/lib/src/diesel.rs",
"chars": 4163,
"preview": "//! Re-export of [`diesel`] with prelude types overridden with `async` variants\n//! from [`diesel_async`].\n//!\n//! # Usa"
},
{
"path": "contrib/db_pools/lib/src/error.rs",
"chars": 1155,
"preview": "use std::fmt;\n\n/// A general error type for use by [`Pool`](crate::Pool#implementing)\n/// implementors and returned by t"
},
{
"path": "contrib/db_pools/lib/src/lib.rs",
"chars": 9354,
"preview": "//! Asynchronous database driver connection pooling integration for Rocket.\n//!\n//! # Quickstart\n//!\n//! 1. Add `rocket_"
},
{
"path": "contrib/db_pools/lib/src/pool.rs",
"chars": 11790,
"preview": "use rocket::figment::Figment;\n\n#[allow(unused_imports)]\nuse {std::time::Duration, crate::{Error, Config}};\n\n/// Generic "
},
{
"path": "contrib/db_pools/lib/tests/databases.rs",
"chars": 1209,
"preview": "macro_rules! check_types_match {\n ($feature:expr, $name:ident, $Pool:ty, $Conn:ty $(,)?) => (\n #[cfg(feature ="
},
{
"path": "contrib/dyn_templates/Cargo.toml",
"chars": 1091,
"preview": "[package]\nname = \"rocket_dyn_templates\"\nversion = \"0.1.0\"\nauthors = [\"Sergio Benitez <sb@sergio.bz>\"]\ndescription = \"Dyn"
},
{
"path": "contrib/dyn_templates/README.md",
"chars": 1818,
"preview": "# `dyn_templates` [![ci.svg]][ci] [![crates.io]][crate] [![docs.svg]][crate docs]\n\n[crates.io]: https://img.shields.io/c"
},
{
"path": "contrib/dyn_templates/src/context.rs",
"chars": 9811,
"preview": "use std::path::{Path, PathBuf};\nuse std::collections::HashMap;\nuse std::error::Error;\n\nuse crate::engine::Engines;\nuse c"
},
{
"path": "contrib/dyn_templates/src/engine/handlebars.rs",
"chars": 1062,
"preview": "use std::path::Path;\n\nuse handlebars::Handlebars;\nuse rocket::serde::Serialize;\n\nuse crate::engine::Engine;\n\nimpl Engine"
},
{
"path": "contrib/dyn_templates/src/engine/minijinja.rs",
"chars": 2149,
"preview": "use std::sync::Arc;\nuse std::path::Path;\nuse std::collections::HashMap;\n\nuse rocket::serde::Serialize;\nuse minijinja::{E"
},
{
"path": "contrib/dyn_templates/src/engine/mod.rs",
"chars": 5891,
"preview": "use std::path::Path;\nuse std::collections::HashMap;\n\nuse rocket::serde::Serialize;\n\nuse crate::template::TemplateInfo;\n\n"
},
{
"path": "contrib/dyn_templates/src/engine/tera.rs",
"chars": 2082,
"preview": "use std::path::Path;\nuse std::error::Error;\n\nuse tera::{Context, Tera};\nuse rocket::serde::Serialize;\n\nuse crate::engine"
},
{
"path": "contrib/dyn_templates/src/fairing.rs",
"chars": 2886,
"preview": "use rocket::{Rocket, Build, Orbit};\nuse rocket::fairing::{self, Fairing, Info, Kind};\nuse rocket::figment::{Source, valu"
},
{
"path": "contrib/dyn_templates/src/lib.rs",
"chars": 8187,
"preview": "//! Dynamic templating engine support for Rocket.\n//!\n//! This crate adds support for dynamic template rendering to Rock"
},
{
"path": "contrib/dyn_templates/src/metadata.rs",
"chars": 5197,
"preview": "use std::fmt;\nuse std::borrow::Cow;\n\nuse rocket::{Request, Rocket, Ignite, Sentinel};\nuse rocket::http::{Status, Content"
},
{
"path": "contrib/dyn_templates/src/template.rs",
"chars": 13136,
"preview": "use std::borrow::Cow;\nuse std::path::PathBuf;\n\nuse rocket::{Rocket, Orbit, Ignite, Sentinel};\nuse rocket::request::Reque"
},
{
"path": "contrib/dyn_templates/tests/templates/hbs/common/footer.html.hbs",
"chars": 6,
"preview": "Done.\n"
},
{
"path": "contrib/dyn_templates/tests/templates/hbs/common/header.html.hbs",
"chars": 19,
"preview": "Hello {{ title }}!\n"
},
{
"path": "contrib/dyn_templates/tests/templates/hbs/reload.txt.hbs",
"chars": 7,
"preview": "initial"
},
{
"path": "contrib/dyn_templates/tests/templates/hbs/test.html.hbs",
"chars": 79,
"preview": "{{> hbs/common/header }}\n<main> {{ content }} </main>\n{{> hbs/common/footer }}\n"
},
{
"path": "contrib/dyn_templates/tests/templates/j2/[test]/html_test.html.j2",
"chars": 130,
"preview": "{% extends \"j2/base\" %}\n{% block title %}{{ title }}{% endblock title %}\n{% block content %}\n{{ content }}\n{% endblock c"
},
{
"path": "contrib/dyn_templates/tests/templates/j2/base.txt.j2",
"chars": 182,
"preview": "{% block head %}\nh_start\ntitle: {% block title %}{% endblock title %}\nh_end\n{% endblock head %}\n{% block content %}{% en"
},
{
"path": "contrib/dyn_templates/tests/templates/j2/html_test.html.j2",
"chars": 130,
"preview": "{% extends \"j2/base\" %}\n{% block title %}{{ title }}{% endblock title %}\n{% block content %}\n{{ content }}\n{% endblock c"
},
{
"path": "contrib/dyn_templates/tests/templates/j2/txt_test.txt.j2",
"chars": 130,
"preview": "{% extends \"j2/base\" %}\n{% block title %}{{ title }}{% endblock title %}\n{% block content %}\n{{ content }}\n{% endblock c"
},
{
"path": "contrib/dyn_templates/tests/templates/tera/[test]/html_test.html.tera",
"chars": 132,
"preview": "{% extends \"tera/base\" %}\n{% block title %}{{ title }}{% endblock title %}\n{% block content %}\n{{ content }}\n{% endblock"
},
{
"path": "contrib/dyn_templates/tests/templates/tera/base.txt.tera",
"chars": 183,
"preview": "{% block head %}\nh_start\ntitle: {% block title %}{% endblock title %}\nh_end\n{% endblock head %}\n{% block content %}{% en"
},
{
"path": "contrib/dyn_templates/tests/templates/tera/html_test.html.tera",
"chars": 132,
"preview": "{% extends \"tera/base\" %}\n{% block title %}{{ title }}{% endblock title %}\n{% block content %}\n{{ content }}\n{% endblock"
},
{
"path": "contrib/dyn_templates/tests/templates/tera/txt_test.txt.tera",
"chars": 132,
"preview": "{% extends \"tera/base\" %}\n{% block title %}{{ title }}{% endblock title %}\n{% block content %}\n{{ content }}\n{% endblock"
},
{
"path": "contrib/dyn_templates/tests/templates.rs",
"chars": 15846,
"preview": "#[macro_use] extern crate rocket;\n\nuse std::path::{Path, PathBuf};\n\nuse rocket::{Rocket, Build};\nuse rocket::config::Con"
},
{
"path": "contrib/sync_db_pools/README.md",
"chars": 1698,
"preview": "# `sync_db_pools` [![ci.svg]][ci] [![crates.io]][crate] [![docs.svg]][crate docs]\n\n[crates.io]: https://img.shields.io/c"
},
{
"path": "contrib/sync_db_pools/codegen/Cargo.toml",
"chars": 637,
"preview": "[package]\nname = \"rocket_sync_db_pools_codegen\"\nversion = \"0.1.0\"\nauthors = [\"Sergio Benitez <sb@sergio.bz>\"]\ndescriptio"
},
{
"path": "contrib/sync_db_pools/codegen/src/database.rs",
"chars": 4910,
"preview": "use proc_macro::TokenStream;\nuse devise::{Spanned, Result, ext::SpanDiagnosticExt};\n\nuse crate::syn;\n\n#[derive(Debug)]\ns"
},
{
"path": "contrib/sync_db_pools/codegen/src/lib.rs",
"chars": 1924,
"preview": "//! Code generation for rocket-sync-db-pools.\n\n#![recursion_limit=\"256\"]\n#![warn(rust_2018_idioms)]\n\n#[macro_use]\nextern"
},
{
"path": "contrib/sync_db_pools/codegen/tests/ui-fail/database-syntax.rs",
"chars": 1095,
"preview": "use rocket_sync_db_pools::database;\n\nstruct Connection;\nstruct Manager;\n\nuse rocket::{Rocket, Build};\nuse rocket_sync_db"
},
{
"path": "contrib/sync_db_pools/codegen/tests/ui-fail/database-types.rs",
"chars": 160,
"preview": "#[macro_use] extern crate rocket_sync_db_pools;\n\nstruct Unknown;\n\n#[database(\"foo\")]\nstruct A(Unknown);\n\n#[database(\"foo"
},
{
"path": "contrib/sync_db_pools/codegen/tests/ui-fail-nightly/database-syntax.stderr",
"chars": 1635,
"preview": "error: unexpected end of input, expected string literal\n --> tests/ui-fail-nightly/database-syntax.rs:27:1\n |\n27 | #["
},
{
"path": "contrib/sync_db_pools/codegen/tests/ui-fail-nightly/database-types.stderr",
"chars": 12177,
"preview": "error[E0277]: the trait bound `Unknown: Poolable` is not satisfied\n --> tests/ui-fail-nightly/database-types.rs:6:10\n |"
},
{
"path": "contrib/sync_db_pools/codegen/tests/ui-fail-stable/database-syntax.stderr",
"chars": 1625,
"preview": "error: unexpected end of input, expected string literal\n --> tests/ui-fail-stable/database-syntax.rs:27:1\n |\n27 | #[d"
},
{
"path": "contrib/sync_db_pools/codegen/tests/ui-fail-stable/database-types.stderr",
"chars": 12161,
"preview": "error[E0277]: the trait bound `Unknown: Poolable` is not satisfied\n --> tests/ui-fail-stable/database-types.rs:6:10\n |\n"
},
{
"path": "contrib/sync_db_pools/codegen/tests/ui-fail.rs",
"chars": 262,
"preview": "#[test]\n#[ignore]\nfn ui() {\n let path = match version_check::is_feature_flaggable() {\n Some(true) => \"ui-fail-"
},
{
"path": "contrib/sync_db_pools/lib/Cargo.toml",
"chars": 1612,
"preview": "[package]\nname = \"rocket_sync_db_pools\"\nversion = \"0.1.0\"\nauthors = [\"Sergio Benitez <sb@sergio.bz>\"]\ndescription = \"Roc"
},
{
"path": "contrib/sync_db_pools/lib/build.rs",
"chars": 129,
"preview": "fn main() {\n if let Some(true) = version_check::is_feature_flaggable() {\n println!(\"cargo:rustc-cfg=nightly\");"
},
{
"path": "contrib/sync_db_pools/lib/src/config.rs",
"chars": 4130,
"preview": "use rocket::{Rocket, Build};\nuse rocket::figment::{self, Figment, providers::Serialized};\n\nuse serde::{Serialize, Deseri"
},
{
"path": "contrib/sync_db_pools/lib/src/connection.rs",
"chars": 9440,
"preview": "use std::sync::Arc;\nuse std::marker::PhantomData;\n\nuse rocket::{Phase, Rocket, Ignite, Sentinel};\nuse rocket::fairing::{"
},
{
"path": "contrib/sync_db_pools/lib/src/error.rs",
"chars": 810,
"preview": "use rocket::figment;\n\n/// A wrapper around `r2d2::Error`s or a custom database error type.\n///\n/// This type is only rel"
},
{
"path": "contrib/sync_db_pools/lib/src/lib.rs",
"chars": 20974,
"preview": "//! Traits, utilities, and a macro for easy database connection pooling.\n//!\n//! # Overview\n//!\n//! This crate provides "
},
{
"path": "contrib/sync_db_pools/lib/src/poolable.rs",
"chars": 11531,
"preview": "#[allow(unused)]\nuse std::time::Duration;\n\nuse r2d2::ManageConnection;\nuse rocket::{Rocket, Build};\n\n#[allow(unused_impo"
},
{
"path": "contrib/sync_db_pools/lib/tests/databases.rs",
"chars": 3866,
"preview": "#[cfg(all(feature = \"diesel_sqlite_pool\", feature = \"diesel_postgres_pool\"))]\nmod databases_tests {\n #![allow(dead_co"
},
{
"path": "contrib/sync_db_pools/lib/tests/drop-with-connection.rs",
"chars": 655,
"preview": "#![cfg(feature = \"diesel_sqlite_pool\")]\n\nuse rocket::figment::Figment;\nuse rocket_sync_db_pools::database;\n\n#[database(\""
},
{
"path": "contrib/sync_db_pools/lib/tests/shutdown.rs",
"chars": 1024,
"preview": "#[cfg(test)]\n#[cfg(all(feature = \"diesel_sqlite_pool\"))]\nmod sqlite_shutdown_test {\n use rocket::{async_test, Build, "
},
{
"path": "contrib/ws/Cargo.toml",
"chars": 756,
"preview": "[package]\nname = \"rocket_ws\"\nversion = \"0.1.0\"\nauthors = [\"Sergio Benitez <sb@sergio.bz>\"]\ndescription = \"WebSocket supp"
},
{
"path": "contrib/ws/README.md",
"chars": 1006,
"preview": "# `ws` [![ci.svg]][ci] [![crates.io]][crate] [![docs.svg]][crate docs]\n\n[crates.io]: https://img.shields.io/crates/v/roc"
},
{
"path": "contrib/ws/src/duplex.rs",
"chars": 2754,
"preview": "use std::pin::Pin;\nuse std::task::{Context, Poll};\n\nuse rocket::data::IoStream;\nuse rocket::futures::{StreamExt, SinkExt"
},
{
"path": "contrib/ws/src/lib.rs",
"chars": 9624,
"preview": "//! WebSocket support for Rocket.\n//!\n//! This crate implements support for WebSockets via Rocket's [connection\n//! upgr"
},
{
"path": "contrib/ws/src/websocket.rs",
"chars": 10631,
"preview": "use std::io;\n\nuse rocket::data::{IoHandler, IoStream};\nuse rocket::futures::{self, StreamExt, SinkExt, future::BoxFuture"
},
{
"path": "core/codegen/Cargo.toml",
"chars": 992,
"preview": "[package]\nname = \"rocket_codegen\"\nversion = \"0.6.0-dev\"\nauthors = [\"Sergio Benitez <sb@sergio.bz>\"]\ndescription = \"Proce"
},
{
"path": "core/codegen/src/attribute/async_bound/mod.rs",
"chars": 1924,
"preview": "use proc_macro2::{TokenStream, Span};\nuse devise::{Spanned, Result, ext::SpanDiagnosticExt};\nuse syn::{Token, parse_quot"
},
{
"path": "core/codegen/src/attribute/catch/mod.rs",
"chars": 3896,
"preview": "mod parse;\n\nuse devise::ext::SpanDiagnosticExt;\nuse devise::{Spanned, Result};\nuse proc_macro2::{TokenStream, Span};\n\nus"
},
{
"path": "core/codegen/src/attribute/catch/parse.rs",
"chars": 1996,
"preview": "use devise::ext::SpanDiagnosticExt;\nuse devise::{MetaItem, Spanned, Result, FromMeta, Diagnostic};\nuse proc_macro2::Toke"
},
{
"path": "core/codegen/src/attribute/entry/launch.rs",
"chars": 4380,
"preview": "use devise::{Spanned, Result};\nuse devise::ext::SpanDiagnosticExt;\nuse proc_macro2::{TokenStream, Span};\n\nuse super::Ent"
},
{
"path": "core/codegen/src/attribute/entry/main.rs",
"chars": 1031,
"preview": "use crate::attribute::suppress::Lint;\n\nuse super::EntryAttr;\n\nuse devise::{Spanned, Result};\nuse devise::ext::SpanDiagno"
},
{
"path": "core/codegen/src/attribute/entry/mod.rs",
"chars": 2015,
"preview": "mod main;\nmod launch;\nmod test;\n\nuse devise::{Diagnostic, Spanned, Result};\nuse devise::ext::SpanDiagnosticExt;\nuse proc"
},
{
"path": "core/codegen/src/attribute/entry/test.rs",
"chars": 568,
"preview": "use super::EntryAttr;\n\nuse devise::{Spanned, Result};\nuse proc_macro2::TokenStream;\n\n/// `#[rocket::async_test]`: calls "
},
{
"path": "core/codegen/src/attribute/mod.rs",
"chars": 99,
"preview": "pub mod entry;\npub mod catch;\npub mod route;\npub mod param;\npub mod async_bound;\npub mod suppress;\n"
},
{
"path": "core/codegen/src/attribute/param/guard.rs",
"chars": 841,
"preview": "use std::hash::{Hash, Hasher};\n\nuse devise::{FromMeta, MetaItem, Result};\nuse proc_macro2::Span;\n\nuse crate::name::Name;"
},
{
"path": "core/codegen/src/attribute/param/mod.rs",
"chars": 2513,
"preview": "mod parse;\n\nuse std::ops::Deref;\nuse std::hash::Hash;\n\nuse crate::name::Name;\n\n#[derive(Debug, Clone, PartialEq, Eq, Has"
},
{
"path": "core/codegen/src/attribute/param/parse.rs",
"chars": 8695,
"preview": "use unicode_xid::UnicodeXID;\nuse devise::{Diagnostic, ext::SpanDiagnosticExt};\nuse proc_macro2::Span;\n\nuse crate::name::"
},
{
"path": "core/codegen/src/attribute/route/mod.rs",
"chars": 18820,
"preview": "mod parse;\n\nuse std::hash::Hash;\n\nuse devise::{Spanned, SpanWrapped, Result, FromMeta, Diagnostic};\nuse devise::ext::Typ"
},
{
"path": "core/codegen/src/attribute/route/parse.rs",
"chars": 9240,
"preview": "use devise::{Spanned, SpanWrapped, Result, FromMeta};\nuse devise::ext::{SpanDiagnosticExt, TypeExt};\nuse indexmap::{Inde"
},
{
"path": "core/codegen/src/attribute/suppress/lint.rs",
"chars": 3509,
"preview": "use std::cell::RefCell;\nuse std::collections::{HashMap, HashSet};\nuse std::ops::Range;\n\nuse devise::ext::PathExt;\nuse pr"
},
{
"path": "core/codegen/src/attribute/suppress/mod.rs",
"chars": 466,
"preview": "use proc_macro2::TokenStream;\nuse devise::Spanned;\n\nmod lint;\n\npub use lint::Lint;\n\npub fn suppress_attribute(\n args:"
},
{
"path": "core/codegen/src/bang/export.rs",
"chars": 2036,
"preview": "use std::hash::Hash;\n\nuse devise::Spanned;\nuse devise::ext::SpanDiagnosticExt;\nuse proc_macro2::{TokenStream, TokenTree,"
},
{
"path": "core/codegen/src/bang/mod.rs",
"chars": 2670,
"preview": "mod uri;\nmod uri_parsing;\nmod test_guide;\nmod export;\n\npub mod typed_stream;\n\nuse devise::Result;\nuse syn::{Path, punctu"
},
{
"path": "core/codegen/src/bang/test_guide.rs",
"chars": 1652,
"preview": "use std::path::Path;\nuse std::error::Error;\n\nuse syn::{Ident, LitStr};\nuse devise::ext::SpanDiagnosticExt;\nuse proc_macr"
},
{
"path": "core/codegen/src/bang/typed_stream.rs",
"chars": 3289,
"preview": "use proc_macro2::TokenStream;\nuse syn::parse::{Parse, ParseStream, discouraged::Speculative};\n\n#[derive(Debug)]\npub enum"
},
{
"path": "core/codegen/src/bang/uri.rs",
"chars": 9847,
"preview": "use std::fmt::Display;\n\nuse devise::{Result, ext::{SpanDiagnosticExt, quote_respanned}};\nuse syn::{Expr, Ident, Type, sp"
},
{
"path": "core/codegen/src/bang/uri_parsing.rs",
"chars": 19528,
"preview": "use std::ops::Deref;\n\nuse indexmap::IndexMap;\nuse devise::{Spanned, ext::TypeExt};\nuse quote::{ToTokens, TokenStreamExt}"
},
{
"path": "core/codegen/src/derive/form_field.rs",
"chars": 15908,
"preview": "use std::collections::HashSet;\n\nuse devise::{*, ext::{TypeExt, SpanDiagnosticExt}};\n\nuse syn::{visit_mut::VisitMut, visi"
},
{
"path": "core/codegen/src/derive/from_form.rs",
"chars": 12455,
"preview": "use proc_macro2::TokenStream;\nuse devise::ext::{TypeExt, SpanDiagnosticExt, GenericsExt, quote_respanned};\nuse syn::pars"
},
{
"path": "core/codegen/src/derive/from_form_field.rs",
"chars": 3493,
"preview": "use devise::{*, ext::SpanDiagnosticExt};\nuse proc_macro2::TokenStream;\n\nuse crate::exports::*;\nuse crate::derive::form_f"
},
{
"path": "core/codegen/src/derive/from_param.rs",
"chars": 1418,
"preview": "use devise::*;\nuse devise::ext::SpanDiagnosticExt;\n\nuse quote::quote;\nuse proc_macro2::TokenStream;\nuse syn::ext::IdentE"
},
{
"path": "core/codegen/src/derive/mod.rs",
"chars": 120,
"preview": "mod form_field;\npub mod from_form;\npub mod from_form_field;\npub mod responder;\npub mod uri_display;\npub mod from_param;\n"
},
{
"path": "core/codegen/src/derive/responder.rs",
"chars": 4466,
"preview": "use quote::ToTokens;\nuse devise::{*, ext::{TypeExt, SpanDiagnosticExt}};\nuse proc_macro2::TokenStream;\n\nuse crate::expor"
},
{
"path": "core/codegen/src/derive/uri_display.rs",
"chars": 6868,
"preview": "use proc_macro2::TokenStream;\nuse devise::{*, ext::SpanDiagnosticExt};\n\nuse crate::exports::*;\nuse crate::derive::form_f"
},
{
"path": "core/codegen/src/exports.rs",
"chars": 3515,
"preview": "use proc_macro2::{Span, TokenStream};\nuse quote::{ToTokens, TokenStreamExt};\n\n#[derive(Debug, Copy, Clone)]\npub struct S"
},
{
"path": "core/codegen/src/http_codegen.rs",
"chars": 6927,
"preview": "use quote::ToTokens;\nuse devise::{FromMeta, MetaItem, Result, ext::{Split2, SpanDiagnosticExt}};\nuse proc_macro2::{Token"
},
{
"path": "core/codegen/src/lib.rs",
"chars": 54105,
"preview": "#![recursion_limit=\"128\"]\n\n#![doc(html_root_url = \"https://api.rocket.rs/master\")]\n#![doc(html_favicon_url = \"https://ro"
},
{
"path": "core/codegen/src/name.rs",
"chars": 2723,
"preview": "use crate::http::uncased::UncasedStr;\n\nuse syn::{Ident, ext::IdentExt};\nuse proc_macro2::{Span, TokenStream};\n\n/// A \"na"
},
{
"path": "core/codegen/src/proc_macro_ext.rs",
"chars": 2268,
"preview": "use std::ops::RangeBounds;\n\nuse devise::Diagnostic;\nuse proc_macro2::{Span, Literal};\n\n// An experiment.\npub struct Diag"
},
{
"path": "core/codegen/src/syn_ext.rs",
"chars": 7221,
"preview": "//! Extensions to `syn` types.\n\nuse std::ops::Deref;\nuse std::hash::{Hash, Hasher};\nuse std::borrow::Cow;\n\nuse syn::{Ide"
},
{
"path": "core/codegen/tests/async-entry.rs",
"chars": 1962,
"preview": "#![allow(dead_code, unused_variables)]\n\nmod a {\n // async launch that is async.\n #[rocket::launch]\n async fn ro"
},
{
"path": "core/codegen/tests/async-routes.rs",
"chars": 487,
"preview": "#![allow(dead_code)]\n\n#[macro_use] extern crate rocket;\nuse rocket::http::uri::Origin;\nuse rocket::request::Request;\n\nas"
},
{
"path": "core/codegen/tests/catcher.rs",
"chars": 2440,
"preview": "// Rocket sometimes generates mangled identifiers that activate the\n// non_snake_case lint. We deny the lint in this tes"
},
{
"path": "core/codegen/tests/expansion.rs",
"chars": 1555,
"preview": "#[macro_use] extern crate rocket;\n\nuse rocket::local::blocking::Client;\n\n#[get(\"/easy/<id>\")]\nfn easy(id: i32) -> String"
},
{
"path": "core/codegen/tests/from_form.rs",
"chars": 33468,
"preview": "use std::net::{IpAddr, SocketAddr};\nuse std::collections::{BTreeMap, HashMap};\n\nuse pretty_assertions::assert_eq;\n\nuse r"
},
{
"path": "core/codegen/tests/from_form_field.rs",
"chars": 2925,
"preview": "use rocket::form::{FromFormField, ValueField, FromForm, Options, Errors};\n\nfn parse<'v, T: FromForm<'v>>(value: &'v str)"
},
{
"path": "core/codegen/tests/from_param.rs",
"chars": 678,
"preview": "use rocket::request::FromParam;\n\n#[allow(non_camel_case_types)]\n#[derive(Debug, FromParam, PartialEq)]\nenum Test {\n T"
},
{
"path": "core/codegen/tests/responder.rs",
"chars": 4934,
"preview": "use rocket::local::asynchronous::Client;\nuse rocket::http::{Status, ContentType, Cookie};\nuse rocket::response::Responde"
},
{
"path": "core/codegen/tests/route-data.rs",
"chars": 1403,
"preview": "#[macro_use] extern crate rocket;\n\nuse rocket::{Request, Data};\nuse rocket::local::blocking::Client;\nuse rocket::data::{"
},
{
"path": "core/codegen/tests/route-format.rs",
"chars": 3963,
"preview": "#[macro_use] extern crate rocket;\n\nuse rocket::local::blocking::Client;\nuse rocket::http::{ContentType, MediaType, Accep"
},
{
"path": "core/codegen/tests/route-ranking.rs",
"chars": 1565,
"preview": "#[macro_use] extern crate rocket;\n\nuse rocket::local::blocking::Client;\n\n// Test that manual/auto ranking works as expec"
},
{
"path": "core/codegen/tests/route-raw.rs",
"chars": 1250,
"preview": "#[macro_use] extern crate rocket;\n\nuse rocket::local::blocking::Client;\n\n// Test that raw idents can be used for route p"
},
{
"path": "core/codegen/tests/route-uniqueness.rs",
"chars": 1746,
"preview": "#[macro_use] extern crate rocket;\n\n#[get(\"/\")]\nfn index() { }\n\nmod module {\n // This one has all the same macro input"
},
{
"path": "core/codegen/tests/route.rs",
"chars": 10468,
"preview": "// Rocket sometimes generates mangled identifiers that activate the\n// non_snake_case lint. We deny the lint in this tes"
},
{
"path": "core/codegen/tests/segment-ignore.rs",
"chars": 1895,
"preview": "#[macro_use]\nextern crate rocket;\n\n#[get(\"/<_>\", rank = 1)] fn ig_1() -> &'static str { \"1\" }\n\n#[get(\"/static\")] fn just"
},
{
"path": "core/codegen/tests/typed-uris.rs",
"chars": 28094,
"preview": "#![allow(dead_code, unused_variables)]\n\n#[macro_use] extern crate rocket;\n\nuse std::path::PathBuf;\n\nuse rocket::http::Co"
},
{
"path": "core/codegen/tests/ui-fail/async-entry.rs",
"chars": 1457,
"preview": "#![allow(dead_code)]\n\nmod main_a {\n #[rocket::main]\n fn foo() { }\n\n}\n\nmod main_b {\n #[rocket::main]\n async f"
},
{
"path": "core/codegen/tests/ui-fail/bad-ignored-segments.rs",
"chars": 146,
"preview": "#[macro_use] extern crate rocket;\n\n#[get(\"/<_>\")]\nfn i0() {}\n\n#[get(\"/c?<_>\")]\nfn i1() {}\n\n#[post(\"/d\", data = \"<_>\")]\nf"
},
{
"path": "core/codegen/tests/ui-fail/catch.rs",
"chars": 519,
"preview": "#[macro_use] extern crate rocket;\n\nuse rocket::Request;\n\n#[catch(404)]\nstruct Catcher(String);\n\n#[catch(404)]\nconst CATC"
},
{
"path": "core/codegen/tests/ui-fail/catch_type_errors.rs",
"chars": 296,
"preview": "#[macro_use] extern crate rocket;\n\nuse rocket::Request;\n\n#[catch(404)]\nfn f1(_request: &Request) -> usize {\n 10\n}\n\n#["
},
{
"path": "core/codegen/tests/ui-fail/catchers.rs",
"chars": 160,
"preview": "#[macro_use] extern crate rocket;\n\nfn main() {\n let _ = catchers![a b];\n let _ = catchers![];\n let _ = catchers"
},
{
"path": "core/codegen/tests/ui-fail/from_form.rs",
"chars": 3528,
"preview": "use rocket::form::FromForm;\n\n#[derive(FromForm)]\nenum Thing { }\n\n#[derive(FromForm)]\nstruct Foo1;\n\n#[derive(FromForm)]\ns"
},
{
"path": "core/codegen/tests/ui-fail/from_form_field.rs",
"chars": 1649,
"preview": "#[macro_use] extern crate rocket;\n\n#[derive(FromFormField)]\nstruct Foo1;\n\n#[derive(FromFormField)]\nstruct Foo2(usize);\n\n"
},
{
"path": "core/codegen/tests/ui-fail/from_form_type_errors.rs",
"chars": 208,
"preview": "#[macro_use] extern crate rocket;\n\nstruct Unknown;\n\n#[derive(FromForm)]\nstruct BadType3 {\n field: Unknown,\n}\n\nstruct "
},
{
"path": "core/codegen/tests/ui-fail/from_param.rs",
"chars": 242,
"preview": "use rocket::request::FromParam;\n\n#[derive(FromParam)]\nstruct Foo1 {\n a: String\n}\n\n#[derive(FromParam)]\nstruct Foo2 {}"
},
{
"path": "core/codegen/tests/ui-fail/responder-types.rs",
"chars": 401,
"preview": "#[macro_use] extern crate rocket;\n\n#[derive(Responder)]\nstruct Thing1 {\n thing: u8,\n}\n\n#[derive(Responder)]\nstruct Th"
},
{
"path": "core/codegen/tests/ui-fail/responder.rs",
"chars": 1245,
"preview": "#[macro_use] extern crate rocket;\n\n#[derive(Responder)]\nstruct Thing1;\n\n#[derive(Responder)]\nstruct Thing2();\n\n#[derive("
},
{
"path": "core/codegen/tests/ui-fail/route-attribute-general-syntax.rs",
"chars": 1499,
"preview": "#[macro_use] extern crate rocket;\n\n// Check a path is supplied, at least.\n#[get()]\nfn a0() {}\n\n// Check that it only wor"
},
{
"path": "core/codegen/tests/ui-fail/route-path-bad-syntax.rs",
"chars": 1492,
"preview": "#[macro_use] extern crate rocket;\n\n// Check that route paths are absolute and normalized.\n\n#[get(\"a\")]\nfn f0() {}\n\n#[get"
},
{
"path": "core/codegen/tests/ui-fail/route-type-errors.rs",
"chars": 401,
"preview": "#[macro_use] extern crate rocket;\n\nstruct Q;\n\n#[get(\"/<_foo>\")]\nfn f0(_foo: Q) {}\n\n#[get(\"/<_foo..>\")]\nfn f1(_foo: Q) {}"
},
{
"path": "core/codegen/tests/ui-fail/route-warnings.rs",
"chars": 703,
"preview": "// must-compile-successfully\n\n#[macro_use] extern crate rocket;\n\n// Check for unknown media types.\n\n#[get(\"/\", format = "
},
{
"path": "core/codegen/tests/ui-fail/routes.rs",
"chars": 152,
"preview": "#[macro_use] extern crate rocket;\n\nfn main() {\n let _ = routes![a b];\n let _ = routes![];\n let _ = routes![a::,"
},
{
"path": "core/codegen/tests/ui-fail/synchronize.sh",
"chars": 626,
"preview": "#!/usr/bin/env bash\nset -e\n\n# Symlinks all of the tests in this directory with those in sibling\n# `ui-fail-stable` and `"
},
{
"path": "core/codegen/tests/ui-fail/typed-uri-bad-type.rs",
"chars": 2023,
"preview": "#![allow(unused_variables)]\n\n#[macro_use] extern crate rocket;\n\nuse rocket::request::FromParam;\n\nstruct S;\n\nimpl<'a> Fro"
},
{
"path": "core/codegen/tests/ui-fail/typed-uris-bad-params.rs",
"chars": 1477,
"preview": "#![allow(unused_variables)]\n\n#[macro_use] extern crate rocket;\n\nuse rocket::http::CookieJar;\n\n#[post(\"/<id>\")]\nfn has_on"
},
{
"path": "core/codegen/tests/ui-fail/typed-uris-invalid-syntax.rs",
"chars": 1093,
"preview": "#[macro_use] extern crate rocket;\n\n#[get(\"/\")]\nfn index() { }\n\n#[post(\"/<_id>/<_name>\")]\nfn simple(_id: i32, _name: Str"
},
{
"path": "core/codegen/tests/ui-fail/uri_display.rs",
"chars": 573,
"preview": "#[macro_use] extern crate rocket;\n\n#[derive(UriDisplayQuery)]\nstruct Foo1;\n\n#[derive(UriDisplayQuery)]\nstruct Foo2();\n\n#"
},
{
"path": "core/codegen/tests/ui-fail/uri_display_type_errors.rs",
"chars": 565,
"preview": "#[macro_use] extern crate rocket;\n\nstruct BadType;\n\n#[derive(UriDisplayQuery)]\nstruct Bar1(BadType);\n\n#[derive(UriDispla"
},
{
"path": "core/codegen/tests/ui-fail-nightly/async-entry.stderr",
"chars": 6481,
"preview": "error: attribute can only be applied to `async` functions\n --> tests/ui-fail-nightly/async-entry.rs:4:5\n |\n4 | #[ro"
},
{
"path": "core/codegen/tests/ui-fail-nightly/bad-ignored-segments.stderr",
"chars": 390,
"preview": "error: parameter must be named\n --> tests/ui-fail-nightly/bad-ignored-segments.rs:6:12\n |\n6 | #[get(\"/c?<_>\")]\n | "
},
{
"path": "core/codegen/tests/ui-fail-nightly/catch.stderr",
"chars": 2418,
"preview": "error: expected `fn`\n --> tests/ui-fail-nightly/catch.rs:6:1\n |\n6 | struct Catcher(String);\n | ^^^^^^\n |\n = help: `#"
},
{
"path": "core/codegen/tests/ui-fail-nightly/catch_type_errors.stderr",
"chars": 4050,
"preview": "error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied\n --> tests/ui-fail-nightly/catch_type_errors.r"
},
{
"path": "core/codegen/tests/ui-fail-nightly/catchers.stderr",
"chars": 558,
"preview": "error: expected `,`\n --> tests/ui-fail-nightly/catchers.rs:4:25\n |\n4 | let _ = catchers![a b];\n | "
},
{
"path": "core/codegen/tests/ui-fail-nightly/from_form.stderr",
"chars": 20215,
"preview": "error: enums are not supported\n --> tests/ui-fail-nightly/from_form.rs:4:1\n |\n4 | enum Thing { }\n | ^^^^^^^^^^^^^^\n |"
},
{
"path": "core/codegen/tests/ui-fail-nightly/from_form_field.stderr",
"chars": 9953,
"preview": "error: tuple structs are not supported\n --> tests/ui-fail-nightly/from_form_field.rs:4:1\n |\n4 | struct Foo1;\n | ^^^^^^"
},
{
"path": "core/codegen/tests/ui-fail-nightly/from_form_type_errors.stderr",
"chars": 9208,
"preview": "error[E0277]: the trait bound `Unknown: FromFormField<'_>` is not satisfied\n --> tests/ui-fail-nightly/from_form_type_er"
},
{
"path": "core/codegen/tests/ui-fail-nightly/from_param.stderr",
"chars": 1678,
"preview": "error: named structs are not supported\n --> tests/ui-fail-nightly/from_param.rs:4:1\n |\n4 | / struct Foo1 {\n5 | | a:"
},
{
"path": "core/codegen/tests/ui-fail-nightly/responder-types.stderr",
"chars": 6703,
"preview": "error[E0277]: the trait bound `u8: Responder<'_, '_>` is not satisfied\n --> tests/ui-fail-nightly/responder-types.rs:5:1"
},
{
"path": "core/codegen/tests/ui-fail-nightly/responder.stderr",
"chars": 4851,
"preview": "error: need at least one field\n --> tests/ui-fail-nightly/responder.rs:4:1\n |\n4 | struct Thing1;\n | ^^^^^^^^^^^^^^\n |"
},
{
"path": "core/codegen/tests/ui-fail-nightly/route-attribute-general-syntax.stderr",
"chars": 6790,
"preview": "error: missing expected parameter: `uri`\n --> tests/ui-fail-nightly/route-attribute-general-syntax.rs:4:1\n |\n4 | #[get("
},
{
"path": "core/codegen/tests/ui-fail-nightly/route-path-bad-syntax.stderr",
"chars": 6630,
"preview": "error: invalid route URI: expected token '/' but found 'a' at index 0\n --> tests/ui-fail-nightly/route-path-bad-syntax.r"
},
{
"path": "core/codegen/tests/ui-fail-nightly/route-type-errors.stderr",
"chars": 6659,
"preview": "error[E0277]: the trait bound `Q: FromParam<'_>` is not satisfied\n --> tests/ui-fail-nightly/route-type-errors.rs:6:13\n "
},
{
"path": "core/codegen/tests/ui-fail-nightly/route-warnings.stderr",
"chars": 1745,
"preview": "warning: 'application/x-custom' is not a known format or media type\n --> tests/ui-fail-nightly/route-warnings.rs:7:21\n "
},
{
"path": "core/codegen/tests/ui-fail-nightly/routes.stderr",
"chars": 538,
"preview": "error: expected `,`\n --> tests/ui-fail-nightly/routes.rs:4:23\n |\n4 | let _ = routes![a b];\n | "
},
{
"path": "core/codegen/tests/ui-fail-nightly/typed-uri-bad-type.stderr",
"chars": 37679,
"preview": "error[E0271]: type mismatch resolving `<String as FromParam<'_>>::Error == &str`\n --> tests/ui-fail-nightly/typed-uri-b"
},
{
"path": "core/codegen/tests/ui-fail-nightly/typed-uris-bad-params.stderr",
"chars": 9632,
"preview": "error: expected identifier, found keyword `_`\n --> tests/ui-fail-nightly/typed-uris-bad-params.rs:65:18\n |\n65 | u"
},
{
"path": "core/codegen/tests/ui-fail-nightly/typed-uris-invalid-syntax.stderr",
"chars": 4925,
"preview": "error: unexpected token\n --> tests/ui-fail-nightly/typed-uris-invalid-syntax.rs:10:16\n |\n10 | uri!(simple: id = 1"
},
{
"path": "core/codegen/tests/ui-fail-nightly/uri_display.stderr",
"chars": 4033,
"preview": "error: fieldless structs are not supported\n --> tests/ui-fail-nightly/uri_display.rs:4:1\n |\n4 | struct Foo1;\n | ^^^^^^"
},
{
"path": "core/codegen/tests/ui-fail-nightly/uri_display_type_errors.stderr",
"chars": 10903,
"preview": "error[E0277]: the trait bound `BadType: UriDisplay<rocket::http::uri::fmt::Query>` is not satisfied\n --> tests/ui-fail-n"
},
{
"path": "core/codegen/tests/ui-fail-stable/async-entry.stderr",
"chars": 6008,
"preview": "error: attribute can only be applied to `async` functions\n --> tests/ui-fail-stable/async-entry.rs:4:5\n |\n4 | #[roc"
},
{
"path": "core/codegen/tests/ui-fail-stable/bad-ignored-segments.stderr",
"chars": 390,
"preview": "error: parameter must be named\n = help: use a name such as `_guard` or `_param`\n --> tests/ui-fail-stable/bad-igno"
},
{
"path": "core/codegen/tests/ui-fail-stable/catch.stderr",
"chars": 2401,
"preview": "error: expected `fn`\n = help: `#[catch]` can only be used on functions\n --> tests/ui-fail-stable/catch.rs:6:1\n |\n"
},
{
"path": "core/codegen/tests/ui-fail-stable/catch_type_errors.stderr",
"chars": 3724,
"preview": "error[E0277]: the trait bound `usize: Responder<'_, '_>` is not satisfied\n --> tests/ui-fail-stable/catch_type_errors.rs"
},
{
"path": "core/codegen/tests/ui-fail-stable/catchers.stderr",
"chars": 507,
"preview": "error: expected `,`\n --> $DIR/catchers.rs:4:25\n |\n4 | let _ = catchers![a b];\n | ^\n\nerror:"
},
{
"path": "core/codegen/tests/ui-fail-stable/from_form.stderr",
"chars": 20829,
"preview": "error: enums are not supported\n --> tests/ui-fail-stable/from_form.rs:4:1\n |\n4 | enum Thing { }\n | ^^^^^^^^^^^^^^\n\nerr"
},
{
"path": "core/codegen/tests/ui-fail-stable/from_form_field.stderr",
"chars": 10187,
"preview": "error: tuple structs are not supported\n --> tests/ui-fail-stable/from_form_field.rs:4:1\n |\n4 | struct Foo1;\n | ^^^^^^^"
},
{
"path": "core/codegen/tests/ui-fail-stable/from_form_type_errors.stderr",
"chars": 9382,
"preview": "error[E0277]: the trait bound `Unknown: FromFormField<'_>` is not satisfied\n --> tests/ui-fail-stable/from_form_type_err"
},
{
"path": "core/codegen/tests/ui-fail-stable/from_param.stderr",
"chars": 1706,
"preview": "error: named structs are not supported\n --> tests/ui-fail-stable/from_param.rs:4:1\n |\n4 | / struct Foo1 {\n5 | | a: "
},
{
"path": "core/codegen/tests/ui-fail-stable/responder-types.stderr",
"chars": 6217,
"preview": "error[E0277]: the trait bound `u8: Responder<'_, '_>` is not satisfied\n --> tests/ui-fail-stable/responder-types.rs:5:12"
},
{
"path": "core/codegen/tests/ui-fail-stable/responder.stderr",
"chars": 4928,
"preview": "error: need at least one field\n --> tests/ui-fail-stable/responder.rs:4:1\n |\n4 | struct Thing1;\n | ^^^^^^^^^^^^^^\n\nerr"
},
{
"path": "core/codegen/tests/ui-fail-stable/route-attribute-general-syntax.stderr",
"chars": 6748,
"preview": "error: missing expected parameter: `uri`\n --> tests/ui-fail-stable/route-attribute-general-syntax.rs:4:1\n |\n4 | #[get()"
},
{
"path": "core/codegen/tests/ui-fail-stable/route-path-bad-syntax.stderr",
"chars": 5063,
"preview": "error: invalid route URI: expected token '/' but found 'a' at index 0\n = help: expected URI in origin form: \"/path"
}
]
// ... and 486 more files (download for full content)
About this extraction
This page contains the full source code of the rwf2/Rocket GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 686 files (3.3 MB), approximately 908.4k tokens, and a symbol index with 4388 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.