pub struct Handlers<Ctx> { /* private fields */ }
Implementations§
Source§impl<Ctx: 'static> Handlers<Ctx>
impl<Ctx: 'static> Handlers<Ctx>
pub fn new() -> Handlers<Ctx>
pub fn new_http_handler( self, context_generator: fn(&HttpRequest) -> Ctx, ) -> HttpHandler
pub fn register<Req, Res: ReqResBound>(
&mut self,
callback: impl Fn(Req, Ctx) -> Result<Res, String> + Send + Sync + 'static,
)where
Req: Request<Res> + ReqResBound,
pub fn dispatch(&self, request_payload: &str, ctx: Ctx) -> String
Auto Trait Implementations§
impl<Ctx> Freeze for Handlers<Ctx>
impl<Ctx> !RefUnwindSafe for Handlers<Ctx>
impl<Ctx> Send for Handlers<Ctx>
impl<Ctx> Sync for Handlers<Ctx>
impl<Ctx> Unpin for Handlers<Ctx>
impl<Ctx> !UnwindSafe for Handlers<Ctx>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more