Trait UnitService

Source
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§

Source

fn handle_request(&mut self, req: Request<'_>) -> UnitResult<()>

Implementors§

Source§

impl<F> UnitService for F
where F: FnMut(Request<'_>) -> UnitResult<()> + 'static,

Source§

impl<H: HttpService + RefUnwindSafe> UnitService for HttpHandler<H>

Available on crate feature http only.