Page Menu
Home
DevCentral
Search
Configure Global Search
Log In
Files
F11822938
D3723.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D3723.diff
View Options
diff --git a/axum/Cargo.toml b/axum/Cargo.toml
--- a/axum/Cargo.toml
+++ b/axum/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "limiting-factor-axum"
-version = "0.1.0"
+version = "0.2.0"
authors = [
"Sébastien Santoro <dereckson@espace-win.org>",
]
diff --git a/axum/src/api/replies.rs b/axum/src/api/replies.rs
--- a/axum/src/api/replies.rs
+++ b/axum/src/api/replies.rs
@@ -50,6 +50,16 @@
fn response(&self) -> String;
}
+impl FailureResponse for StatusCode {
+ fn status_code(&self) -> StatusCode {
+ self.clone()
+ }
+
+ fn response(&self) -> String {
+ self.canonical_reason().unwrap_or_default().to_string()
+ }
+}
+
impl<T, E> ApiResponse<T> for Result<T, E>
where T: ApiResponse<T>, E: FailureResponse
{
diff --git a/axum/src/app.rs b/axum/src/app.rs
--- a/axum/src/app.rs
+++ b/axum/src/app.rs
@@ -55,6 +55,13 @@
self
}
+ pub fn from_router(router: Router) -> Self {
+ Self {
+ config: ServerConfig::from_env(),
+ router,
+ }
+ }
+
fn resolve_router(&self) -> Router {
if self.config.mount_point == "/" {
return self.router.clone();
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Sep 26, 00:37 (20 h, 55 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3017675
Default Alt Text
D3723.diff (1 KB)
Attached To
Mode
D3723: Support features required by Docker Registry API
Attached
Detach File
Event Timeline
Log In to Comment