use super::*;
impl Default for ServerControlHook {
#[inline(always)]
fn default() -> Self {
Self {
wait_hook: Arc::new(|| Box::pin(async {})),
shutdown_hook: Arc::new(|| Box::pin(async {})),
}
}
}
impl ServerControlHook {
pub async fn wait(&self) {
(self.get_wait_hook())().await;
}
pub async fn shutdown(&self) {
(self.get_shutdown_hook())().await;
}
}
impl HandlerState {
#[inline(always)]
pub(crate) fn new(socket: ArcRwLockUdpSocket) -> Self {
Self { socket }
}
}
impl ServerHook for DefaultServerHook {
async fn new(_ctx: &Context) -> Self {
Self
}
async fn handle(self, _ctx: &Context) {}
}