Skip to content

Commit

Permalink
deploy: c99d61d
Browse files Browse the repository at this point in the history
  • Loading branch information
jbearer committed Jun 5, 2024
1 parent aaed5da commit c111e8d
Show file tree
Hide file tree
Showing 104 changed files with 356 additions and 1,417 deletions.
2 changes: 1 addition & 1 deletion search-index.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions src/tide_disco/api.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -3347,7 +3347,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
|_req, _conn: Connection&lt;(), (), <span class="kw">_</span>, StaticVer01&gt;, _state| {
<span class="kw">async move </span>{
<span class="prelude-val">Err</span>(ServerError::catch_all(
StatusCode::InternalServerError,
StatusCode::INTERNAL_SERVER_ERROR,
<span class="string">"an error message"</span>.to_string(),
))
}
Expand Down Expand Up @@ -3471,7 +3471,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="comment">// We intentionally return a stream that never terminates, to check that simply
// yielding an error causes the connection to terminate.
</span>repeat(<span class="prelude-val">Err</span>(ServerError::catch_all(
StatusCode::InternalServerError,
StatusCode::INTERNAL_SERVER_ERROR,
<span class="string">"an error message"</span>.to_string(),
)))
.boxed()
Expand Down Expand Up @@ -3539,7 +3539,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="kw">let </span>client = Client::new(url).<span class="kw">await</span>;

<span class="kw">let </span>res = client.get(<span class="string">"/mod/healthcheck"</span>).send().<span class="kw">await</span>.unwrap();
<span class="macro">assert_eq!</span>(res.status(), StatusCode::Ok);
<span class="macro">assert_eq!</span>(res.status(), StatusCode::OK);
<span class="macro">assert_eq!</span>(
res.json::&lt;HealthStatus&gt;().<span class="kw">await</span>.unwrap(),
HealthStatus::Available
Expand Down Expand Up @@ -3595,7 +3595,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="macro">tracing::info!</span>(<span class="string">"making metrics request {i}"</span>);
<span class="kw">let </span>expected = <span class="macro">format!</span>(<span class="string">"# HELP counter count of how many times metrics have been exported\n# TYPE counter counter\ncounter {i}\n"</span>);
<span class="kw">let </span>res = client.get(<span class="string">"mod/metrics"</span>).send().<span class="kw">await</span>.unwrap();
<span class="macro">assert_eq!</span>(res.status(), StatusCode::Ok);
<span class="macro">assert_eq!</span>(res.status(), StatusCode::OK);
<span class="macro">assert_eq!</span>(res.text().<span class="kw">await</span>.unwrap(), expected);
}
}
Expand Down
60 changes: 30 additions & 30 deletions src/tide_disco/app.rs.html

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions src/tide_disco/error.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,19 +140,19 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="kw">fn </span>status(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; StatusCode;

<span class="kw">fn </span>from_io_error(source: IoError) -&gt; <span class="self">Self </span>{
<span class="self">Self</span>::catch_all(StatusCode::InternalServerError, source.to_string())
<span class="self">Self</span>::catch_all(StatusCode::INTERNAL_SERVER_ERROR, source.to_string())
}

<span class="kw">fn </span>from_config_error(source: ConfigError) -&gt; <span class="self">Self </span>{
<span class="self">Self</span>::catch_all(StatusCode::InternalServerError, source.to_string())
<span class="self">Self</span>::catch_all(StatusCode::INTERNAL_SERVER_ERROR, source.to_string())
}

<span class="kw">fn </span>from_route_error&lt;E: Display&gt;(source: RouteError&lt;E&gt;) -&gt; <span class="self">Self </span>{
<span class="self">Self</span>::catch_all(source.status(), source.to_string())
}

<span class="kw">fn </span>from_request_error(source: RequestError) -&gt; <span class="self">Self </span>{
<span class="self">Self</span>::catch_all(StatusCode::BadRequest, source.to_string())
<span class="self">Self</span>::catch_all(StatusCode::BAD_REQUEST, source.to_string())
}

<span class="kw">fn </span>from_socket_error&lt;E: Display&gt;(source: SocketError&lt;E&gt;) -&gt; <span class="self">Self </span>{
Expand Down
8 changes: 4 additions & 4 deletions src/tide_disco/healthcheck.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
/// A type implementing [HealthCheck] may be returned from a healthcheck endpoint itself (via its
/// [Serialize] implementation) as well as incorporated automatically into the global healthcheck
/// endpoint for an app. The global healthcheck will fail if any of the module healthchecks return
/// an implementation `h` of [HealthCheck] where `h.status() != StatusCode::Ok`.
/// an implementation `h` of [HealthCheck] where `h.status() != StatusCode::OK`.
///
/// We provide a standard implementation [HealthStatus] which has variants for common states an
/// application might encounter. We recommend using this implementation as a standard, although it
Expand All @@ -80,7 +80,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
</span><span class="kw">pub trait </span>HealthCheck: Serialize {
<span class="doccomment">/// The status of this health check.
///
/// Should return [StatusCode::Ok] if the status is considered healthy, and some other status
/// Should return [StatusCode::OK] if the status is considered healthy, and some other status
/// code if it is not.
</span><span class="kw">fn </span>status(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; StatusCode;
}
Expand Down Expand Up @@ -109,8 +109,8 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="comment">// Return healthy in normal states even if the state is not `Available`, so that load
// balances and health monitors don't kill the service while it is starting up or
// gracefully shutting down.
</span><span class="self">Self</span>::Available | <span class="self">Self</span>::Initializing | <span class="self">Self</span>::ShuttingDown =&gt; StatusCode::Ok,
<span class="kw">_ </span>=&gt; StatusCode::ServiceUnavailable,
</span><span class="self">Self</span>::Available | <span class="self">Self</span>::Initializing | <span class="self">Self</span>::ShuttingDown =&gt; StatusCode::OK,
<span class="kw">_ </span>=&gt; StatusCode::SERVICE_UNAVAILABLE,
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/tide_disco/lib.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -1183,7 +1183,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
req: tide::Request&lt;AppServerState&gt;,
) -&gt; <span class="prelude-ty">Result</span>&lt;tide::Response, tide::Error&gt; {
<span class="kw">let </span>status = req.state().health_status.read().<span class="kw">await</span>;
<span class="prelude-val">Ok</span>(tide::Response::builder(StatusCode::Ok)
<span class="prelude-val">Ok</span>(tide::Response::builder(StatusCode::OK)
.content_type(mime::JSON)
.body(<span class="macro">tide::prelude::json!</span>({<span class="string">"status"</span>: status.as_ref() }))
.build())
Expand Down
8 changes: 4 additions & 4 deletions src/tide_disco/listener.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>

<span class="doccomment">/// TCP listener which accepts only a limited number of connections at a time.
///
/// This listener is based on [`tide::listener::TcpListener`] and should match the semantics of that
/// This listener is based on `tide::listener::TcpListener` and should match the semantics of that
/// listener in every way, accept that when there are more simultaneous outstanding requests than
/// the configured limit, excess requests will fail immediately with error code 429 (Too Many
/// Requests).
Expand Down Expand Up @@ -356,7 +356,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
</span>} <span class="kw">else </span>{
<span class="comment">// Otherwise, we are rate limited. Respond immediately with an
// error.
</span><span class="prelude-val">Ok</span>(http::Response::new(StatusCode::TooManyRequests))
</span><span class="prelude-val">Ok</span>(http::Response::new(StatusCode::TOO_MANY_REQUESTS))
}
});

Expand Down Expand Up @@ -466,11 +466,11 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>

<span class="comment">// The next request gets rate limited.
</span><span class="kw">let </span>res = client.get(<span class="string">"mod/test"</span>).send().<span class="kw">await</span>.unwrap();
<span class="macro">assert_eq!</span>(StatusCode::TooManyRequests, res.status());
<span class="macro">assert_eq!</span>(StatusCode::TOO_MANY_REQUESTS, res.status());

<span class="comment">// The other requests eventually complete successfully.
</span><span class="kw">for </span>res <span class="kw">in </span>try_join_all(reqs).<span class="kw">await</span>.unwrap() {
<span class="macro">assert_eq!</span>(StatusCode::Ok, res.status());
<span class="macro">assert_eq!</span>(StatusCode::OK, res.status());
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/tide_disco/request.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -1080,7 +1080,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
///
/// impl From&lt;RequestError&gt; for ApiError {
/// fn from(err: RequestError) -&gt; Self {
/// Self::catch_all(StatusCode::BadRequest, err.to_string())
/// Self::catch_all(StatusCode::BAD_REQUEST, err.to_string())
/// }
/// }
///
Expand Down
8 changes: 4 additions & 4 deletions src/tide_disco/route.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -757,9 +757,9 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="kw">pub fn </span>status(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; StatusCode {
<span class="kw">match </span><span class="self">self </span>{
<span class="self">Self</span>::Request(<span class="kw">_</span>) | <span class="self">Self</span>::UnsupportedContentType | <span class="self">Self</span>::IncorrectMethod { .. } =&gt; {
StatusCode::BadRequest
StatusCode::BAD_REQUEST
}
<span class="kw">_ </span>=&gt; StatusCode::InternalServerError,
<span class="kw">_ </span>=&gt; StatusCode::INTERNAL_SERVER_ERROR,
}
}

Expand Down Expand Up @@ -1183,7 +1183,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="doccomment">/// Print documentation about the route, to aid the developer when the route is not yet
/// implemented.
</span><span class="kw">pub</span>(<span class="kw">crate</span>) <span class="kw">fn </span>default_handler(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; <span class="prelude-ty">Result</span>&lt;tide::Response, RouteError&lt;Error&gt;&gt; {
<span class="prelude-val">Ok</span>(tide::Response::builder(StatusCode::NotImplemented)
<span class="prelude-val">Ok</span>(tide::Response::builder(StatusCode::NOT_IMPLEMENTED)
.body(<span class="self">self</span>.documentation().into_string())
.build())
}
Expand Down Expand Up @@ -1351,7 +1351,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="kw">_</span>: VER,
) -&gt; <span class="prelude-ty">Result</span>&lt;tide::Response, RouteError&lt;E&gt;&gt; {
<span class="kw">let </span>(body, content_type) = response_body::&lt;<span class="kw">_</span>, <span class="kw">_</span>, VER&gt;(accept, body)<span class="question-mark">?</span>;
<span class="prelude-val">Ok</span>(tide::Response::builder(StatusCode::Ok)
<span class="prelude-val">Ok</span>(tide::Response::builder(StatusCode::OK)
.body(body)
.content_type(content_type)
.build())
Expand Down
4 changes: 2 additions & 2 deletions src/tide_disco/socket.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -473,9 +473,9 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="kw">pub fn </span>status(<span class="kw-2">&amp;</span><span class="self">self</span>) -&gt; StatusCode {
<span class="kw">match </span><span class="self">self </span>{
<span class="self">Self</span>::Request(<span class="kw">_</span>) | <span class="self">Self</span>::UnsupportedMessageType | <span class="self">Self</span>::IncorrectMethod { .. } =&gt; {
StatusCode::BadRequest
StatusCode::BAD_REQUEST
}
<span class="kw">_ </span>=&gt; StatusCode::InternalServerError,
<span class="kw">_ </span>=&gt; StatusCode::INTERNAL_SERVER_ERROR,
}
}

Expand Down
Loading

0 comments on commit c111e8d

Please sign in to comment.