mirror of https://github.com/rwf2/Rocket.git
parent
0d48743bd8
commit
124ec94b46
|
@ -141,7 +141,7 @@ pub use self::tungstenite::Message;
|
||||||
/// max_send_queue: Some(5),
|
/// max_send_queue: Some(5),
|
||||||
/// // Decrease the maximum (complete) message size to 4MiB.
|
/// // Decrease the maximum (complete) message size to 4MiB.
|
||||||
/// max_message_size: Some(4.mebibytes().as_u64() as usize),
|
/// max_message_size: Some(4.mebibytes().as_u64() as usize),
|
||||||
/// // Decrease the maximum size of _one_ frame (not messag) to 1MiB.
|
/// // Decrease the maximum size of _one_ frame (not message) to 1MiB.
|
||||||
/// max_frame_size: Some(1.mebibytes().as_u64() as usize),
|
/// max_frame_size: Some(1.mebibytes().as_u64() as usize),
|
||||||
/// // Use the default values for the rest.
|
/// // Use the default values for the rest.
|
||||||
/// ..Default::default()
|
/// ..Default::default()
|
||||||
|
|
|
@ -444,7 +444,7 @@ fn form_validate_contains_all_errors() {
|
||||||
#[field(validate = evaluate())]
|
#[field(validate = evaluate())]
|
||||||
firstname: String,
|
firstname: String,
|
||||||
check: bool,
|
check: bool,
|
||||||
// this validator is hardcoded to return an error but it doesnt
|
// this validator is hardcoded to return an error but it doesn't
|
||||||
#[field(validate = evaluate_with_argument(self.check))]
|
#[field(validate = evaluate_with_argument(self.check))]
|
||||||
lastname: String,
|
lastname: String,
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ error: attribute cannot be applied to `main` function
|
||||||
note: this function cannot be `main`
|
note: this function cannot be `main`
|
||||||
--> tests/ui-fail-nightly/async-entry.rs:50:8
|
--> tests/ui-fail-nightly/async-entry.rs:50:8
|
||||||
|
|
|
|
||||||
50 | fn main() -> rocekt::Rocket<rocket::Build> {
|
50 | fn main() -> rocket::Rocket<rocket::Build> {
|
||||||
| ^^^^
|
| ^^^^
|
||||||
= note: this error originates in the attribute macro `rocket::launch` (in Nightly builds, run with -Z macro-backtrace for more info)
|
= note: this error originates in the attribute macro `rocket::launch` (in Nightly builds, run with -Z macro-backtrace for more info)
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ error: attribute cannot be applied to `main` function
|
||||||
error: [note] this function cannot be `main`
|
error: [note] this function cannot be `main`
|
||||||
--> tests/ui-fail-stable/async-entry.rs:50:8
|
--> tests/ui-fail-stable/async-entry.rs:50:8
|
||||||
|
|
|
|
||||||
50 | fn main() -> rocekt::Rocket<rocket::Build> {
|
50 | fn main() -> rocket::Rocket<rocket::Build> {
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
||||||
error: attribute can only be applied to functions that return a value
|
error: attribute can only be applied to functions that return a value
|
||||||
|
|
|
@ -47,7 +47,7 @@ mod launch_b {
|
||||||
|
|
||||||
mod launch_c {
|
mod launch_c {
|
||||||
#[rocket::launch]
|
#[rocket::launch]
|
||||||
fn main() -> rocekt::Rocket<rocket::Build> {
|
fn main() -> rocket::Rocket<rocket::Build> {
|
||||||
rocket::build()
|
rocket::build()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -114,7 +114,7 @@
|
||||||
// .map_err(|e| errors.push(e))
|
// .map_err(|e| errors.push(e))
|
||||||
// .map(Some).unwrap_or(None);
|
// .map(Some).unwrap_or(None);
|
||||||
//
|
//
|
||||||
// let field_b = B::finblize(&mut this.field_b)
|
// let field_b = B::finalize(&mut this.field_b)
|
||||||
// .map_err(|e| errors.push(e))
|
// .map_err(|e| errors.push(e))
|
||||||
// .map(Some).unwrap_or(None);
|
// .map(Some).unwrap_or(None);
|
||||||
//
|
//
|
||||||
|
|
|
@ -200,7 +200,7 @@ macro_rules! pub_request_impl {
|
||||||
/// Set mTLS client certificates to send along with the request.
|
/// Set mTLS client certificates to send along with the request.
|
||||||
///
|
///
|
||||||
/// If the request already contained certificates, they are replaced with
|
/// If the request already contained certificates, they are replaced with
|
||||||
/// thsoe in `reader.`
|
/// those in `reader.`
|
||||||
///
|
///
|
||||||
/// `reader` is expected to be PEM-formatted and contain X509 certificates.
|
/// `reader` is expected to be PEM-formatted and contain X509 certificates.
|
||||||
/// If it contains more than one certificate, the entire chain is set on the
|
/// If it contains more than one certificate, the entire chain is set on the
|
||||||
|
|
|
@ -89,7 +89,7 @@ pub type Outcome<S, E> = outcome::Outcome<S, (Status, E), Status>;
|
||||||
/// * **Forward**(Status)
|
/// * **Forward**(Status)
|
||||||
///
|
///
|
||||||
/// If the `Outcome` is [`Forward`], the request will be forwarded to the next
|
/// If the `Outcome` is [`Forward`], the request will be forwarded to the next
|
||||||
/// matching route until either one succeds or there are no further matching
|
/// matching route until either one succeeds or there are no further matching
|
||||||
/// routes to attempt. In the latter case, the request will be sent to the
|
/// routes to attempt. In the latter case, the request will be sent to the
|
||||||
/// [`Catcher`](crate::Catcher) for the designated `Status`. Note that users
|
/// [`Catcher`](crate::Catcher) for the designated `Status`. Note that users
|
||||||
/// can request an `Option<S>` to catch `Forward`s.
|
/// can request an `Option<S>` to catch `Forward`s.
|
||||||
|
|
|
@ -783,7 +783,7 @@ mod sse_tests {
|
||||||
yield Event::data("bar");
|
yield Event::data("bar");
|
||||||
};
|
};
|
||||||
|
|
||||||
// We expect: foo\n\n [heartbeat] bar\n\n [maybe beartbeat].
|
// We expect: foo\n\n [heartbeat] bar\n\n [maybe heartbeat].
|
||||||
let string = stream.heartbeat(Duration::from_millis(350)).into_string();
|
let string = stream.heartbeat(Duration::from_millis(350)).into_string();
|
||||||
let heartbeats = string.matches(HEARTBEAT).count();
|
let heartbeats = string.matches(HEARTBEAT).count();
|
||||||
assert!(heartbeats >= 1 && heartbeats <= 3, "got {} beat(s)", heartbeats);
|
assert!(heartbeats >= 1 && heartbeats <= 3, "got {} beat(s)", heartbeats);
|
||||||
|
|
|
@ -176,10 +176,10 @@ impl From<&Referrer> for Header<'static> {
|
||||||
/// The [Expect-CT] header: enables reporting and/or enforcement of [Certificate
|
/// The [Expect-CT] header: enables reporting and/or enforcement of [Certificate
|
||||||
/// Transparency].
|
/// Transparency].
|
||||||
///
|
///
|
||||||
/// [Certificate Transparency] can detect and prevent the use of misissued,
|
/// [Certificate Transparency] can detect and prevent the use of incorrectly
|
||||||
/// malicious, or revoked TLS certificates. It solves a variety of problems with
|
/// issued malicious, or revoked TLS certificates. It solves a variety of
|
||||||
/// public TLS/SSL certificate management and is valuable measure for all public
|
/// problems with public TLS/SSL certificate management and is valuable measure
|
||||||
/// TLS applications.
|
/// for all public TLS applications.
|
||||||
///
|
///
|
||||||
/// If you're just [getting started] with certificate transparency, ensure that
|
/// If you're just [getting started] with certificate transparency, ensure that
|
||||||
/// your [site is in compliance][getting started] before you enable enforcement
|
/// your [site is in compliance][getting started] before you enable enforcement
|
||||||
|
|
|
@ -145,7 +145,7 @@ fn test_forwarding() {
|
||||||
fn test_redirection() {
|
fn test_redirection() {
|
||||||
let client = Client::debug(rocket()).expect("valid rocket");
|
let client = Client::debug(rocket()).expect("valid rocket");
|
||||||
|
|
||||||
// Redirection only happens if enabled, and doesn't affect index behaviour.
|
// Redirection only happens if enabled, and doesn't affect index behavior.
|
||||||
let response = client.get("/no_index/inner").dispatch();
|
let response = client.get("/no_index/inner").dispatch();
|
||||||
assert_eq!(response.status(), Status::NotFound);
|
assert_eq!(response.status(), Status::NotFound);
|
||||||
|
|
||||||
|
|
|
@ -504,8 +504,8 @@ fn index() -> Template {
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
For a template to be renderable, it must first be registered. The `Template`
|
To render a template, it must first be registered. The `Template` fairing
|
||||||
fairing automatically registers all discoverable templates when attached. The
|
automatically registers all discoverable templates when attached. The
|
||||||
[Fairings](../fairings) sections of the guide provides more information on
|
[Fairings](../fairings) sections of the guide provides more information on
|
||||||
fairings. To attach the template fairing, simply call
|
fairings. To attach the template fairing, simply call
|
||||||
`.attach(Template::fairing())` on an instance of `Rocket` as follows:
|
`.attach(Template::fairing())` on an instance of `Rocket` as follows:
|
||||||
|
|
|
@ -21,7 +21,7 @@ The process for using managed state is simple:
|
||||||
|
|
||||||
! note: All managed state must be thread-safe.
|
! note: All managed state must be thread-safe.
|
||||||
|
|
||||||
Because Rocket automatically multithreads your application, handlers can
|
Because Rocket automatically parallelizes your application, handlers can
|
||||||
concurrently access managed state. As a result, managed state must be
|
concurrently access managed state. As a result, managed state must be
|
||||||
thread-safe. Thanks to Rust, this condition is checked at compile-time by
|
thread-safe. Thanks to Rust, this condition is checked at compile-time by
|
||||||
ensuring that the type of values you store in managed state implement `Send` +
|
ensuring that the type of values you store in managed state implement `Send` +
|
||||||
|
|
|
@ -17,7 +17,7 @@ contributors at the end of this article.
|
||||||
|
|
||||||
## About Rocket
|
## About Rocket
|
||||||
|
|
||||||
Rocket is a web framework for Rust with a focus on ease of use, expressibility,
|
Rocket is a web framework for Rust with a focus on ease of use, expressiveness,
|
||||||
and speed. Rocket makes it simple to write fast web applications without
|
and speed. Rocket makes it simple to write fast web applications without
|
||||||
sacrificing flexibility or type safety. All with minimal code.
|
sacrificing flexibility or type safety. All with minimal code.
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ support: a sincere thank you to everyone involved!
|
||||||
|
|
||||||
## About Rocket
|
## About Rocket
|
||||||
|
|
||||||
Rocket is a web framework for Rust with a focus on ease of use, expressibility,
|
Rocket is a web framework for Rust with a focus on ease of use, expressiveness,
|
||||||
and speed. Rocket makes it simple to write fast web applications without
|
and speed. Rocket makes it simple to write fast web applications without
|
||||||
sacrificing flexibility or type safety. All with minimal code.
|
sacrificing flexibility or type safety. All with minimal code.
|
||||||
|
|
||||||
|
|
|
@ -31,7 +31,7 @@ Friday, November 9th for the general release!
|
||||||
|
|
||||||
## About Rocket
|
## About Rocket
|
||||||
|
|
||||||
Rocket is a web framework for Rust with a focus on ease of use, expressibility,
|
Rocket is a web framework for Rust with a focus on ease of use, expressiveness,
|
||||||
and speed. Rocket makes it simple to write fast web applications without
|
and speed. Rocket makes it simple to write fast web applications without
|
||||||
sacrificing flexibility or type safety. All with minimal code.
|
sacrificing flexibility or type safety. All with minimal code.
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ Wednesday, December 5th for the general release!
|
||||||
|
|
||||||
## About Rocket
|
## About Rocket
|
||||||
|
|
||||||
Rocket is a web framework for Rust with a focus on ease of use, expressibility,
|
Rocket is a web framework for Rust with a focus on ease of use, expressiveness,
|
||||||
and speed. Rocket makes it simple to write fast web applications without
|
and speed. Rocket makes it simple to write fast web applications without
|
||||||
sacrificing flexibility or type safety. All with minimal code.
|
sacrificing flexibility or type safety. All with minimal code.
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue