From 0e4b8daa3498ac0e75475b05f36d2a363098ca81 Mon Sep 17 00:00:00 2001 From: azw Date: Sat, 11 Nov 2023 08:34:49 +0000 Subject: [PATCH] 1 --- f9/src/app.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/f9/src/app.rs b/f9/src/app.rs index 09d94d1..4d3b7aa 100644 --- a/f9/src/app.rs +++ b/f9/src/app.rs @@ -29,7 +29,7 @@ pub trait UserApp { fn get_http_listen_port(&self) -> i32; } -struct HttpContext { +pub struct HttpContext { id: u64, query_str: String, add_tick: i64, @@ -279,4 +279,8 @@ impl App { }); } + pub fn add_http_handler(&mut self, key: String, cb: Box::) { + self.http_handlers.insert(key, cb); + } + }