pub trait UnitService {
// Required method
fn handle_request(&mut self, req: Request<'_>) -> UnitResult<()>;
}
Expand description
A trait that can be implemented by request handlers to be used with
Unit::set_request_handler()
.
This trait is automatically implemented for functions or lambda functions
that take a Request
object and return a UnitResult<()>
.
Required Methods§
fn handle_request(&mut self, req: Request<'_>) -> UnitResult<()>
Implementors§
impl<F> UnitService for F
impl<H: HttpService + RefUnwindSafe> UnitService for HttpHandler<H>
Available on crate feature
http
only.