udp 3.1.4

A lightweight and efficient Rust library for building UDP servers with request-response handling.
Documentation
use crate::*;

impl ServerHook for EchoHandler {
    async fn new(_ctx: &Context) -> Self {
        Self
    }

    async fn handle(self, ctx: &Context) {
        let request: Request = ctx.get_request().await;
        let response: String = format!("Echo: {request:?}");
        let _ = ctx.send(response).await;
    }
}

impl ServerHook for PanicHandler {
    async fn new(_ctx: &Context) -> Self {
        Self
    }

    async fn handle(self, _ctx: &Context) {
        println!("A task panic occurred");
    }
}