├── .gitattributes
├── examples
├── todo
│ ├── db
│ │ └── DB_LIVES_HERE
│ ├── migrations
│ │ ├── .gitkeep
│ │ └── 20160720150332_create_tasks_table
│ │ │ ├── down.sql
│ │ │ └── up.sql
│ ├── static
│ │ ├── images
│ │ │ └── favicon.png
│ │ └── css
│ │ │ └── style.css
│ ├── Rocket.toml
│ ├── README.md
│ └── Cargo.toml
├── pastebin
│ ├── upload
│ │ └── UPLOADS_GO_HERE
│ ├── Cargo.toml
│ └── src
│ │ ├── main.rs
│ │ └── paste_id.rs
├── databases
│ ├── db
│ │ ├── diesel
│ │ │ └── migrations
│ │ │ │ ├── .gitkeep
│ │ │ │ └── 20210329150332_create_posts_table
│ │ │ │ ├── down.sql
│ │ │ │ └── up.sql
│ │ └── sqlx
│ │ │ └── migrations
│ │ │ └── 20210331024424_create-posts-table.sql
│ ├── Rocket.toml
│ ├── README.md
│ ├── src
│ │ └── main.rs
│ └── Cargo.toml
├── fairings
│ ├── Rocket.toml
│ ├── Cargo.toml
│ └── src
│ │ └── tests.rs
├── static-files
│ ├── static
│ │ ├── hidden
│ │ │ ├── hi.txt
│ │ │ └── index.html
│ │ ├── rocket-icon.jpg
│ │ └── index.html
│ ├── Cargo.toml
│ └── src
│ │ └── main.rs
├── manual-routing
│ ├── Rocket.toml
│ └── Cargo.toml
├── templating
│ ├── Rocket.toml
│ ├── templates
│ │ ├── hbs
│ │ │ ├── footer.html.hbs
│ │ │ ├── nav.html.hbs
│ │ │ ├── layout.html.hbs
│ │ │ ├── error
│ │ │ │ └── 404.html.hbs
│ │ │ └── index.html.hbs
│ │ └── tera
│ │ │ ├── nav.html.tera
│ │ │ ├── error
│ │ │ └── 404.html.tera
│ │ │ ├── base.html.tera
│ │ │ └── index.html.tera
│ ├── Cargo.toml
│ └── src
│ │ ├── main.rs
│ │ ├── tera.rs
│ │ └── hbs.rs
├── forms
│ ├── Rocket.toml
│ ├── Cargo.toml
│ └── templates
│ │ └── success.html.tera
├── tls
│ ├── private
│ │ ├── ed25519.p12
│ │ ├── rsa_sha256.p12
│ │ ├── ecdsa_nistp256_sha256.p12
│ │ ├── ecdsa_nistp384_sha384.p12
│ │ ├── ed25519_key.pem
│ │ ├── ecdsa_nistp256_sha256_key_pkcs8.pem
│ │ ├── ecdsa_nistp384_sha384_key_pkcs8.pem
│ │ ├── ed25519_cert.pem
│ │ ├── ecdsa_nistp256_sha256_cert.pem
│ │ └── ecdsa_nistp384_sha384_cert.pem
│ ├── Cargo.toml
│ ├── src
│ │ ├── tests.rs
│ │ └── main.rs
│ └── Rocket.toml
├── cookies
│ ├── Rocket.toml
│ ├── Cargo.toml
│ ├── templates
│ │ ├── session.html.hbs
│ │ ├── message.html.hbs
│ │ └── login.html.hbs
│ └── src
│ │ ├── main.rs
│ │ └── message.rs
├── hello
│ └── Cargo.toml
├── testing
│ ├── Cargo.toml
│ └── src
│ │ ├── main.rs
│ │ └── async_required.rs
├── error-handling
│ └── Cargo.toml
├── state
│ ├── Cargo.toml
│ └── src
│ │ ├── main.rs
│ │ ├── managed_hit_count.rs
│ │ └── managed_queue.rs
├── config
│ ├── Cargo.toml
│ ├── Rocket.toml
│ └── src
│ │ ├── main.rs
│ │ └── tests.rs
├── responders
│ └── Cargo.toml
├── serialization
│ ├── Cargo.toml
│ └── src
│ │ ├── main.rs
│ │ ├── msgpack.rs
│ │ └── uuid.rs
├── chat
│ ├── Cargo.toml
│ └── static
│ │ ├── reset.css
│ │ └── index.html
└── Cargo.toml
├── core
├── lib
│ ├── tests
│ │ ├── static
│ │ │ ├── .hidden
│ │ │ ├── inner
│ │ │ │ ├── .hideme
│ │ │ │ ├── goodbye
│ │ │ │ └── index.html
│ │ │ ├── other
│ │ │ │ └── hello.txt
│ │ │ └── index.html
│ │ ├── twice_managed_state.rs
│ │ ├── mount_point.rs
│ │ ├── local-client-access-runtime-in-drop.rs
│ │ ├── typed-uri-docs-redef-issue-1373.rs
│ │ ├── config-secret-key-1500.rs
│ │ ├── timer-on-attach.rs
│ │ ├── encoded-uris.rs
│ │ ├── can-correct-bad-local-uri.rs
│ │ ├── on_launch_fairing_can_inspect_port.rs
│ │ ├── redirect_from_catcher-issue-113.rs
│ │ ├── local-client-json.rs
│ │ ├── session-cookies-issue-1506.rs
│ │ ├── can-launch-tls.rs
│ │ ├── tls-config-from-source-1503.rs
│ │ ├── responder_lifetime-issue-345.rs
│ │ ├── absolute-uris-okay-issue-443.rs
│ │ ├── route_guard.rs
│ │ ├── form_value_from_encoded_str-issue-1425.rs
│ │ ├── scoped-uri.rs
│ │ ├── form_value_decoding-issue-82.rs
│ │ ├── unsound-local-request-1312.rs
│ │ ├── form_method-issue-45.rs
│ │ ├── derive-reexports.rs
│ │ ├── local_request_private_cookie-issue-368.rs
│ │ ├── untracked-vs-tracked.rs
│ │ ├── replace-content-type-518.rs
│ │ ├── catcher-cookies-1213.rs
│ │ ├── many-cookie-jars-at-once.rs
│ │ ├── segments-issues-41-86.rs
│ │ ├── uri-percent-encoding-issue-808.rs
│ │ ├── conditionally-set-server-header-996.rs
│ │ ├── mapped-base-issue-1262.rs
│ │ ├── head_handling.rs
│ │ └── flash-lazy-removes-issue-466.rs
│ ├── fuzz
│ │ ├── corpus
│ │ │ └── uri-parsing
│ │ │ │ ├── asterisk.seed
│ │ │ │ ├── authority.seed
│ │ │ │ ├── absolute.seed
│ │ │ │ ├── origin.seed
│ │ │ │ └── reference.seed
│ │ ├── .gitignore
│ │ ├── README.md
│ │ ├── Cargo.toml
│ │ └── targets
│ │ │ ├── uri-parsing.rs
│ │ │ └── uri-roundtrip.rs
│ ├── src
│ │ ├── router
│ │ │ └── mod.rs
│ │ ├── catcher
│ │ │ └── mod.rs
│ │ ├── form
│ │ │ ├── name
│ │ │ │ └── mod.rs
│ │ │ └── options.rs
│ │ ├── route
│ │ │ ├── mod.rs
│ │ │ └── segment.rs
│ │ ├── fs
│ │ │ └── mod.rs
│ │ ├── data
│ │ │ └── mod.rs
│ │ ├── local
│ │ │ ├── asynchronous
│ │ │ │ └── mod.rs
│ │ │ └── blocking
│ │ │ │ └── mod.rs
│ │ ├── serde
│ │ │ └── mod.rs
│ │ ├── mtls.rs
│ │ ├── response
│ │ │ ├── stream
│ │ │ │ └── one.rs
│ │ │ └── mod.rs
│ │ └── request
│ │ │ └── mod.rs
│ └── build.rs
├── codegen
│ ├── tests
│ │ ├── ui-fail-nightly
│ │ │ ├── catch.rs
│ │ │ ├── catchers.rs
│ │ │ ├── routes.rs
│ │ │ ├── from_form.rs
│ │ │ ├── responder.rs
│ │ │ ├── async-entry.rs
│ │ │ ├── uri_display.rs
│ │ │ ├── from_form_field.rs
│ │ │ ├── responder-types.rs
│ │ │ ├── route-warnings.rs
│ │ │ ├── catch_type_errors.rs
│ │ │ ├── route-type-errors.rs
│ │ │ ├── typed-uri-bad-type.rs
│ │ │ ├── bad-ignored-segments.rs
│ │ │ ├── from_form_type_errors.rs
│ │ │ ├── route-path-bad-syntax.rs
│ │ │ ├── typed-uris-bad-params.rs
│ │ │ ├── uri_display_type_errors.rs
│ │ │ ├── typed-uris-invalid-syntax.rs
│ │ │ ├── route-attribute-general-syntax.rs
│ │ │ ├── bad-ignored-segments.stderr
│ │ │ ├── routes.stderr
│ │ │ ├── catchers.stderr
│ │ │ ├── from_form_type_errors.stderr
│ │ │ └── route-warnings.stderr
│ │ ├── ui-fail-stable
│ │ │ ├── catch.rs
│ │ │ ├── routes.rs
│ │ │ ├── catchers.rs
│ │ │ ├── async-entry.rs
│ │ │ ├── from_form.rs
│ │ │ ├── responder.rs
│ │ │ ├── uri_display.rs
│ │ │ ├── from_form_field.rs
│ │ │ ├── responder-types.rs
│ │ │ ├── route-warnings.rs
│ │ │ ├── catch_type_errors.rs
│ │ │ ├── route-type-errors.rs
│ │ │ ├── typed-uri-bad-type.rs
│ │ │ ├── bad-ignored-segments.rs
│ │ │ ├── from_form_type_errors.rs
│ │ │ ├── route-path-bad-syntax.rs
│ │ │ ├── typed-uris-bad-params.rs
│ │ │ ├── uri_display_type_errors.rs
│ │ │ ├── typed-uris-invalid-syntax.rs
│ │ │ ├── route-attribute-general-syntax.rs
│ │ │ ├── route-warnings.stderr
│ │ │ ├── bad-ignored-segments.stderr
│ │ │ ├── routes.stderr
│ │ │ ├── catchers.stderr
│ │ │ ├── from_form_type_errors.stderr
│ │ │ └── catch_type_errors.stderr
│ │ ├── ui-fail
│ │ │ ├── routes.rs
│ │ │ ├── catchers.rs
│ │ │ ├── bad-ignored-segments.rs
│ │ │ ├── from_form_type_errors.rs
│ │ │ ├── catch_type_errors.rs
│ │ │ ├── route-type-errors.rs
│ │ │ ├── responder-types.rs
│ │ │ ├── route-warnings.rs
│ │ │ ├── catch.rs
│ │ │ ├── synchronize.sh
│ │ │ ├── uri_display.rs
│ │ │ ├── uri_display_type_errors.rs
│ │ │ ├── typed-uris-invalid-syntax.rs
│ │ │ ├── responder.rs
│ │ │ ├── typed-uris-bad-params.rs
│ │ │ ├── async-entry.rs
│ │ │ └── route-path-bad-syntax.rs
│ │ ├── ui-fail.rs
│ │ ├── async-routes.rs
│ │ ├── route-raw.rs
│ │ ├── route-data.rs
│ │ ├── route-ranking.rs
│ │ └── expansion.rs
│ ├── src
│ │ ├── attribute
│ │ │ ├── mod.rs
│ │ │ ├── entry
│ │ │ │ ├── test.rs
│ │ │ │ └── main.rs
│ │ │ └── param
│ │ │ │ └── guard.rs
│ │ ├── derive
│ │ │ └── mod.rs
│ │ └── bang
│ │ │ ├── test_guide.rs
│ │ │ └── export.rs
│ └── Cargo.toml
└── http
│ └── src
│ ├── tls
│ └── mod.rs
│ ├── parse
│ ├── mod.rs
│ ├── checkers.rs
│ └── uri
│ │ └── mod.rs
│ ├── uri
│ ├── fmt
│ │ └── mod.rs
│ ├── mod.rs
│ └── error.rs
│ ├── header
│ └── mod.rs
│ ├── hyper.rs
│ └── lib.rs
├── contrib
├── dyn_templates
│ ├── tests
│ │ └── templates
│ │ │ ├── hbs
│ │ │ ├── reload.txt.hbs
│ │ │ ├── common
│ │ │ │ ├── footer.html.hbs
│ │ │ │ └── header.html.hbs
│ │ │ └── test.html.hbs
│ │ │ └── tera
│ │ │ ├── txt_test.txt.tera
│ │ │ ├── html_test.html.tera
│ │ │ └── base.txt.tera
│ ├── Cargo.toml
│ └── src
│ │ └── handlebars_templates.rs
├── db_pools
│ ├── codegen
│ │ ├── tests
│ │ │ ├── ui-fail-nightly
│ │ │ │ ├── database-types.rs
│ │ │ │ ├── database-syntax.rs
│ │ │ │ └── database-types.stderr
│ │ │ ├── ui-fail-stable
│ │ │ │ ├── database-syntax.rs
│ │ │ │ ├── database-types.rs
│ │ │ │ └── database-types.stderr
│ │ │ ├── ui-fail
│ │ │ │ ├── database-types.rs
│ │ │ │ └── database-syntax.rs
│ │ │ └── ui-fail.rs
│ │ └── Cargo.toml
│ └── lib
│ │ └── src
│ │ └── error.rs
└── sync_db_pools
│ ├── codegen
│ ├── tests
│ │ ├── ui-fail-nightly
│ │ │ ├── database-types.rs
│ │ │ ├── database-syntax.rs
│ │ │ ├── database-types.stderr
│ │ │ └── database-syntax.stderr
│ │ ├── ui-fail-stable
│ │ │ ├── database-syntax.rs
│ │ │ ├── database-types.rs
│ │ │ ├── database-types.stderr
│ │ │ └── database-syntax.stderr
│ │ ├── ui-fail
│ │ │ ├── database-types.rs
│ │ │ └── database-syntax.rs
│ │ └── ui-fail.rs
│ └── Cargo.toml
│ └── lib
│ ├── src
│ └── error.rs
│ └── Cargo.toml
├── benchmarks
├── src
│ └── bench.rs
├── Cargo.toml
└── static
│ └── rust-lang.routes
├── .github
└── ISSUE_TEMPLATE
│ ├── config.yml
│ ├── suggestion.md
│ ├── bug-report.md
│ └── feature-request.md
├── Cargo.toml
├── .gitignore
├── site
├── tests
│ ├── Cargo.toml
│ └── src
│ │ └── lib.rs
├── guide
│ ├── 1-quickstart.md
│ └── 11-conclusion.md
└── README.md
├── scripts
├── mk-docs.sh
├── bump_version.sh
└── publish.sh
└── LICENSE-MIT
/.gitattributes:
--------------------------------------------------------------------------------
1 | * text eol=lf
2 |
--------------------------------------------------------------------------------
/examples/todo/db/DB_LIVES_HERE:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/todo/migrations/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/examples/pastebin/upload/UPLOADS_GO_HERE:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/core/lib/tests/static/.hidden:
--------------------------------------------------------------------------------
1 | Peek-a-boo.
2 |
--------------------------------------------------------------------------------
/core/lib/tests/static/inner/.hideme:
--------------------------------------------------------------------------------
1 | Oh no!
2 |
--------------------------------------------------------------------------------
/core/lib/tests/static/other/hello.txt:
--------------------------------------------------------------------------------
1 | Hi!
2 |
--------------------------------------------------------------------------------
/examples/databases/db/diesel/migrations/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/core/lib/fuzz/corpus/uri-parsing/asterisk.seed:
--------------------------------------------------------------------------------
1 | *
2 |
--------------------------------------------------------------------------------
/core/lib/tests/static/inner/goodbye:
--------------------------------------------------------------------------------
1 | Thanks for coming!
2 |
--------------------------------------------------------------------------------
/core/lib/tests/static/inner/index.html:
--------------------------------------------------------------------------------
1 | Inner index.
2 |
--------------------------------------------------------------------------------
/examples/fairings/Rocket.toml:
--------------------------------------------------------------------------------
1 | [global]
2 | token = 123
3 |
--------------------------------------------------------------------------------
/contrib/dyn_templates/tests/templates/hbs/reload.txt.hbs:
--------------------------------------------------------------------------------
1 | initial
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/catch.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/catch.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/catch.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/catch.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/routes.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/routes.rs
--------------------------------------------------------------------------------
/examples/static-files/static/hidden/hi.txt:
--------------------------------------------------------------------------------
1 | You found me! :o
2 |
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/catchers.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/catchers.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/routes.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/routes.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/catchers.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/catchers.rs
--------------------------------------------------------------------------------
/core/lib/tests/static/index.html:
--------------------------------------------------------------------------------
1 | Just a file here: index.html.
2 |
--------------------------------------------------------------------------------
/examples/manual-routing/Rocket.toml:
--------------------------------------------------------------------------------
1 | [global]
2 | port = 8000
3 |
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/from_form.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/from_form.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/responder.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/responder.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/async-entry.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/async-entry.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/from_form.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/from_form.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/responder.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/responder.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/uri_display.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/uri_display.rs
--------------------------------------------------------------------------------
/contrib/dyn_templates/tests/templates/hbs/common/footer.html.hbs:
--------------------------------------------------------------------------------
1 | Done.
2 |
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/async-entry.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/async-entry.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/uri_display.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/uri_display.rs
--------------------------------------------------------------------------------
/core/lib/fuzz/.gitignore:
--------------------------------------------------------------------------------
1 | target
2 | corpus/*/*
3 | artifacts
4 | !*.seed
5 |
--------------------------------------------------------------------------------
/examples/templating/Rocket.toml:
--------------------------------------------------------------------------------
1 | [default]
2 | template_dir = "templates"
3 |
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/from_form_field.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/from_form_field.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/responder-types.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/responder-types.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/route-warnings.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/route-warnings.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/from_form_field.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/from_form_field.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/responder-types.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/responder-types.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/route-warnings.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/route-warnings.rs
--------------------------------------------------------------------------------
/contrib/dyn_templates/tests/templates/hbs/common/header.html.hbs:
--------------------------------------------------------------------------------
1 | Hello {{ title }}!
2 |
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/catch_type_errors.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/catch_type_errors.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/route-type-errors.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/route-type-errors.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/typed-uri-bad-type.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/typed-uri-bad-type.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/catch_type_errors.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/catch_type_errors.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/route-type-errors.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/route-type-errors.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/typed-uri-bad-type.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/typed-uri-bad-type.rs
--------------------------------------------------------------------------------
/core/lib/fuzz/corpus/uri-parsing/authority.seed:
--------------------------------------------------------------------------------
1 | username:password@some.host:8088
2 |
--------------------------------------------------------------------------------
/examples/todo/migrations/20160720150332_create_tasks_table/down.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE tasks
2 |
--------------------------------------------------------------------------------
/contrib/db_pools/codegen/tests/ui-fail-nightly/database-types.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/database-types.rs
--------------------------------------------------------------------------------
/contrib/db_pools/codegen/tests/ui-fail-stable/database-syntax.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/database-syntax.rs
--------------------------------------------------------------------------------
/contrib/db_pools/codegen/tests/ui-fail-stable/database-types.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/database-types.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/bad-ignored-segments.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/bad-ignored-segments.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/bad-ignored-segments.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/bad-ignored-segments.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/from_form_type_errors.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/from_form_type_errors.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/route-path-bad-syntax.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/route-path-bad-syntax.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/typed-uris-bad-params.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/typed-uris-bad-params.rs
--------------------------------------------------------------------------------
/benchmarks/src/bench.rs:
--------------------------------------------------------------------------------
1 | mod routing;
2 |
3 | criterion::criterion_main!(routing::routing);
4 |
--------------------------------------------------------------------------------
/contrib/db_pools/codegen/tests/ui-fail-nightly/database-syntax.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/database-syntax.rs
--------------------------------------------------------------------------------
/contrib/sync_db_pools/codegen/tests/ui-fail-nightly/database-types.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/database-types.rs
--------------------------------------------------------------------------------
/contrib/sync_db_pools/codegen/tests/ui-fail-stable/database-syntax.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/database-syntax.rs
--------------------------------------------------------------------------------
/contrib/sync_db_pools/codegen/tests/ui-fail-stable/database-types.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/database-types.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/from_form_type_errors.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/from_form_type_errors.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/route-path-bad-syntax.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/route-path-bad-syntax.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/typed-uris-bad-params.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/typed-uris-bad-params.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/uri_display_type_errors.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/uri_display_type_errors.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/uri_display_type_errors.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/uri_display_type_errors.rs
--------------------------------------------------------------------------------
/contrib/sync_db_pools/codegen/tests/ui-fail-nightly/database-syntax.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/database-syntax.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/typed-uris-invalid-syntax.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/typed-uris-invalid-syntax.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/typed-uris-invalid-syntax.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/typed-uris-invalid-syntax.rs
--------------------------------------------------------------------------------
/core/lib/fuzz/corpus/uri-parsing/absolute.seed:
--------------------------------------------------------------------------------
1 | http://user:pass@domain.com:4444/foo/bar?some=query
2 |
--------------------------------------------------------------------------------
/core/lib/fuzz/corpus/uri-parsing/origin.seed:
--------------------------------------------------------------------------------
1 | /first_segment/second_segment/third?optional=query
2 |
--------------------------------------------------------------------------------
/examples/forms/Rocket.toml:
--------------------------------------------------------------------------------
1 | [default]
2 | limits.data-form = "2MiB"
3 | template_dir = "templates/"
4 |
--------------------------------------------------------------------------------
/examples/templating/templates/hbs/footer.html.hbs:
--------------------------------------------------------------------------------
1 |
4 |
--------------------------------------------------------------------------------
/examples/databases/db/diesel/migrations/20210329150332_create_posts_table/down.sql:
--------------------------------------------------------------------------------
1 | DROP TABLE posts;
2 |
--------------------------------------------------------------------------------
/core/codegen/src/attribute/mod.rs:
--------------------------------------------------------------------------------
1 | pub mod entry;
2 | pub mod catch;
3 | pub mod route;
4 | pub mod param;
5 |
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-nightly/route-attribute-general-syntax.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/route-attribute-general-syntax.rs
--------------------------------------------------------------------------------
/core/codegen/tests/ui-fail-stable/route-attribute-general-syntax.rs:
--------------------------------------------------------------------------------
1 | ../ui-fail/route-attribute-general-syntax.rs
--------------------------------------------------------------------------------
/core/lib/fuzz/corpus/uri-parsing/reference.seed:
--------------------------------------------------------------------------------
1 | http://user:pass@domain.com:4444/foo/bar?some=query#and-fragment
2 |
--------------------------------------------------------------------------------
/examples/tls/private/ed25519.p12:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rocket-org/Rocket/HEAD/examples/tls/private/ed25519.p12
--------------------------------------------------------------------------------
/examples/templating/templates/hbs/nav.html.hbs:
--------------------------------------------------------------------------------
1 | Hello | About
2 |
--------------------------------------------------------------------------------
/examples/tls/private/rsa_sha256.p12:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rocket-org/Rocket/HEAD/examples/tls/private/rsa_sha256.p12
--------------------------------------------------------------------------------
/examples/templating/templates/tera/nav.html.tera:
--------------------------------------------------------------------------------
1 | Hello | About
2 |
--------------------------------------------------------------------------------
/examples/todo/static/images/favicon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rocket-org/Rocket/HEAD/examples/todo/static/images/favicon.png
--------------------------------------------------------------------------------
/examples/cookies/Rocket.toml:
--------------------------------------------------------------------------------
1 | [default]
2 | secret_key = "itlYmFR2vYKrOmFhupMIn/hyB6lYCCTXz4yaQX89XVg="
3 | template_dir = "templates"
4 |
--------------------------------------------------------------------------------
/examples/todo/Rocket.toml:
--------------------------------------------------------------------------------
1 | [default]
2 | template_dir = "static"
3 |
4 | [default.databases.sqlite_database]
5 | url = "db/db.sqlite"
6 |
--------------------------------------------------------------------------------
/examples/static-files/static/rocket-icon.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/rocket-org/Rocket/HEAD/examples/static-files/static/rocket-icon.jpg
--------------------------------------------------------------------------------
/contrib/dyn_templates/tests/templates/hbs/test.html.hbs:
--------------------------------------------------------------------------------
1 | {{> hbs/common/header }}
2 |
Try going to /tera/hello/Your Name
13 | {% endblock content %} 14 | -------------------------------------------------------------------------------- /core/lib/tests/local-client-access-runtime-in-drop.rs: -------------------------------------------------------------------------------- 1 | use rocket::local::blocking::Client; 2 | 3 | struct SpawnBlockingOnDrop; 4 | 5 | impl Drop for SpawnBlockingOnDrop { 6 | fn drop(&mut self) { 7 | rocket::tokio::task::spawn_blocking(|| ()); 8 | } 9 | } 10 | 11 | #[test] 12 | fn test_access_runtime_in_state_drop() { 13 | Client::debug(rocket::build().manage(SpawnBlockingOnDrop)).unwrap(); 14 | } 15 | -------------------------------------------------------------------------------- /examples/templating/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "templating" 3 | version = "0.0.0" 4 | workspace = "../" 5 | edition = "2018" 6 | publish = false 7 | 8 | [dependencies] 9 | rocket = { path = "../../core/lib" } 10 | 11 | # in your application, you should enable only the template engine(s) used 12 | [dependencies.rocket_dyn_templates] 13 | path = "../../contrib/dyn_templates" 14 | features = ["tera", "handlebars"] 15 | -------------------------------------------------------------------------------- /core/lib/tests/typed-uri-docs-redef-issue-1373.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] // This test is only here to ensure it compiles. 2 | #![allow(unused_variables)] // This test is only here to ensure it compiles. 3 | 4 | mod a { 5 | /// Docs. 6 | #[rocket::post("/typed_uris/Try going to /hbs/hello/Your Name.
15 |Also, check {{ wow "this" }} (custom helper) out!
16 |Logged in with user ID {{ user_id }}.
11 | 14 | 15 | Home 16 | 17 | 18 | -------------------------------------------------------------------------------- /core/codegen/tests/ui-fail-nightly/routes.stderr: -------------------------------------------------------------------------------- 1 | error: expected `,` 2 | --> $DIR/routes.rs:4:23 3 | | 4 | 4 | let _ = routes![a b]; 5 | | ^ 6 | 7 | error: expected identifier 8 | --> $DIR/routes.rs:6:24 9 | | 10 | 6 | let _ = routes![a::, ]; 11 | | ^ 12 | 13 | error: unexpected end of input, expected identifier 14 | --> $DIR/routes.rs:7:13 15 | | 16 | 7 | let _ = routes![a::]; 17 | | ^^^^^^^^^^^^ 18 | | 19 | = note: this error originates in the macro `routes` (in Nightly builds, run with -Z macro-backtrace for more info) 20 | -------------------------------------------------------------------------------- /core/codegen/tests/ui-fail-stable/routes.stderr: -------------------------------------------------------------------------------- 1 | error: expected `,` 2 | --> $DIR/routes.rs:4:23 3 | | 4 | 4 | let _ = routes![a b]; 5 | | ^ 6 | 7 | error: expected identifier 8 | --> $DIR/routes.rs:6:24 9 | | 10 | 6 | let _ = routes![a::, ]; 11 | | ^ 12 | 13 | error: unexpected end of input, expected identifier 14 | --> $DIR/routes.rs:7:13 15 | | 16 | 7 | let _ = routes![a::]; 17 | | ^^^^^^^^^^^^ 18 | | 19 | = note: this error originates in the macro `routes` (in Nightly builds, run with -Z macro-backtrace for more info) 20 | -------------------------------------------------------------------------------- /examples/todo/Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "todo" 3 | version = "0.0.0" 4 | workspace = "../" 5 | edition = "2018" 6 | publish = false 7 | 8 | [dependencies] 9 | rocket = { path = "../../core/lib" } 10 | diesel = { version = "1.3", features = ["sqlite", "r2d2"] } 11 | diesel_migrations = "1.3" 12 | 13 | [dev-dependencies] 14 | parking_lot = "0.11" 15 | rand = "0.8" 16 | 17 | [dependencies.rocket_sync_db_pools] 18 | path = "../../contrib/sync_db_pools/lib/" 19 | features = ["diesel_sqlite_pool"] 20 | 21 | [dependencies.rocket_dyn_templates] 22 | path = "../../contrib/dyn_templates" 23 | features = ["tera"] 24 | -------------------------------------------------------------------------------- /core/lib/src/form/options.rs: -------------------------------------------------------------------------------- 1 | /// Form guard options. 2 | /// 3 | /// See [`Form#leniency`](crate::form::Form#leniency) for details. 4 | #[derive(Debug, Copy, Clone, PartialEq, Eq)] 5 | pub struct Options { 6 | /// Whether parsing should be strict (no extra parameters) or not. 7 | pub strict: bool, 8 | } 9 | 10 | #[allow(non_upper_case_globals, dead_code)] 11 | impl Options { 12 | /// `Options` with `strict` set to `false`. 13 | pub const Lenient: Self = Options { strict: false }; 14 | 15 | /// `Options` with `strict` set to `true`. 16 | pub const Strict: Self = Options { strict: true }; 17 | } 18 | -------------------------------------------------------------------------------- /core/lib/tests/can-correct-bad-local-uri.rs: -------------------------------------------------------------------------------- 1 | use rocket::http::uri::Origin; 2 | use rocket::local::blocking::Client; 3 | 4 | #[test] 5 | fn can_correct_bad_local_uri() { 6 | #[rocket::get("/")] fn f() {} 7 | 8 | let client = Client::debug_with(rocket::routes![f]).unwrap(); 9 | let mut req = client.get("this is a bad URI"); 10 | req.set_uri(Origin::parse("/").unwrap()); 11 | 12 | assert_eq!(req.uri(), "/"); 13 | assert!(req.dispatch().status().class().is_success()); 14 | 15 | let req = client.get("this is a bad URI"); 16 | assert!(req.dispatch().status().class().is_client_error()); 17 | } 18 | -------------------------------------------------------------------------------- /core/codegen/tests/async-routes.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] 2 | 3 | #[macro_use] extern crate rocket; 4 | use rocket::http::uri::Origin; 5 | use rocket::request::Request; 6 | 7 | async fn noop() { } 8 | 9 | #[get("/")] 10 | async fn hello(_origin: &Origin<'_>) -> &'static str { 11 | noop().await; 12 | "Hello, world!" 13 | } 14 | 15 | #[get("/repeated_query?{{message}}
12 | {{else}} 13 |No message yet.
14 | {{/if}} 15 | 16 | 21 | 22 | Home 23 | 24 | 25 | -------------------------------------------------------------------------------- /examples/testing/src/main.rs: -------------------------------------------------------------------------------- 1 | #[macro_use] extern crate rocket; 2 | 3 | mod async_required; 4 | 5 | #[get("/")] 6 | fn hello() -> &'static str { 7 | "Hello, world!" 8 | } 9 | 10 | #[launch] 11 | fn rocket() -> _ { 12 | async_required::rocket().mount("/", routes![hello]) 13 | } 14 | 15 | #[cfg(test)] 16 | mod test { 17 | use super::rocket; 18 | use rocket::http::Status; 19 | 20 | #[test] 21 | fn test_hello() { 22 | use rocket::local::blocking::Client; 23 | 24 | let client = Client::tracked(rocket()).unwrap(); 25 | let response = client.get("/").dispatch(); 26 | assert_eq!(response.status(), Status::Ok); 27 | assert_eq!(response.into_string(), Some("Hello, world!".into())); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /core/codegen/tests/ui-fail/synchronize.sh: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env bash 2 | set -e 3 | 4 | # Symlinks all of the tests in this directory with those in sibling 5 | # `ui-fail-stable` and `ui-fail-nightly` directories. 6 | 7 | SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" 8 | 9 | stable="${SCRIPT_DIR}/../ui-fail-stable" 10 | nightly="${SCRIPT_DIR}/../ui-fail-nightly" 11 | anchor="$(basename ${SCRIPT_DIR})" 12 | 13 | echo ":: Synchronizing..." 14 | echo " stable: ${stable}" 15 | echo " nightly: ${nightly}" 16 | echo " anchor: ${anchor}" 17 | 18 | for dir in "${stable}" "${nightly}"; do 19 | find "${dir}" -type l -delete 20 | 21 | for file in "${SCRIPT_DIR}"/*.rs; do 22 | ln -s "../${anchor}/$(basename $file)" "${dir}/" 23 | done 24 | done 25 | -------------------------------------------------------------------------------- /examples/serialization/src/msgpack.rs: -------------------------------------------------------------------------------- 1 | use rocket::serde::{Serialize, Deserialize, msgpack::MsgPack}; 2 | 3 | #[derive(Serialize, Deserialize)] 4 | #[serde(crate = "rocket::serde")] 5 | struct Message<'r> { 6 | id: usize, 7 | message: &'r str 8 | } 9 | 10 | #[get("/Please login to continue.
12 | 13 | {{#if message}} 14 |{{#if kind}}{{kind}}: {{/if}}{{ message }}
15 | {{/if}} 16 | 17 | 24 | 25 | Home 26 | 27 | 28 | -------------------------------------------------------------------------------- /core/lib/tests/responder_lifetime-issue-345.rs: -------------------------------------------------------------------------------- 1 | #![allow(dead_code)] // This test is only here so that we can ensure it compiles. 2 | 3 | #[macro_use] extern crate rocket; 4 | 5 | use rocket::{Request, State}; 6 | use rocket::response::{Responder, Result}; 7 | 8 | struct SomeState; 9 | 10 | pub struct CustomResponder<'r, R> { 11 | responder: R, 12 | state: &'r SomeState, 13 | } 14 | 15 | impl<'r, 'o: 'r, R: Responder<'r, 'o>> Responder<'r, 'o> for CustomResponder<'r, R> { 16 | fn respond_to(self, req: &'r Request<'_>) -> Result<'o> { 17 | self.responder.respond_to(req) 18 | } 19 | } 20 | 21 | #[get("/unit_state")] 22 | fn unit_state(state: &State