Trait unit_rs::UnitService
source · [−]pub trait UnitService {
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 where
F: FnMut(Request<'_>) -> UnitResult<()> + 'static,
impl<H: HttpService + RefUnwindSafe> UnitService for HttpHandler<H>
Available on crate feature
http only.