From 68b508fda73f5458202e6b3abf52778663954f84 Mon Sep 17 00:00:00 2001 From: Fuwn Date: Wed, 29 Mar 2023 07:58:05 +0000 Subject: refactor(returnable): unify callback context --- examples/windmark.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'examples') diff --git a/examples/windmark.rs b/examples/windmark.rs index 736eb54..fca1c97 100644 --- a/examples/windmark.rs +++ b/examples/windmark.rs @@ -75,17 +75,17 @@ async fn main() -> Result<(), Box> { ); }); router.attach(Clicker::default()); - router.set_pre_route_callback(Box::new(|stream, url, _| { + router.set_pre_route_callback(Box::new(|context| { info!( "accepted connection from {} to {}", - stream.peer_addr().unwrap().ip(), - url.to_string() + context.tcp.peer_addr().unwrap().ip(), + context.url.to_string() ) })); - router.set_post_route_callback(Box::new(|stream, _url, _| { + router.set_post_route_callback(Box::new(|context| { info!( "closed connection from {}", - stream.peer_addr().unwrap().ip() + context.tcp.peer_addr().unwrap().ip() ) })); router.add_header(Box::new(|_| "```\nART IS COOL\n```\nhi".to_string())); -- cgit v1.2.3