Struct rustbus::connection::dispatch_conn::DispatchConn [−][src]
pub struct DispatchConn<HandlerCtx, HandlerError: Debug> { /* fields omitted */ }
Implementations
pub fn new(
conn: DuplexConn,
ctx: UserData,
default_handler: Box<HandleFn<UserData, UserError>>
) -> SelfEndless loop that takes messages and dispatches them to the setup handlers. If any errors occur they will be returned. Depending on the error you may choose to just call this function again. Note that you are expected to send a meaningful error message. The offending message will be returned alongside the error.
This also sends reponses back to the callers, returned by the handlers. If the handlers did return None, it sends a default response with no content.
Auto Trait Implementations
impl<HandlerCtx, HandlerError> !RefUnwindSafe for DispatchConn<HandlerCtx, HandlerError>impl<HandlerCtx, HandlerError> !Send for DispatchConn<HandlerCtx, HandlerError>impl<HandlerCtx, HandlerError> !Sync for DispatchConn<HandlerCtx, HandlerError>impl<HandlerCtx, HandlerError> Unpin for DispatchConn<HandlerCtx, HandlerError> where
HandlerCtx: Unpin, impl<HandlerCtx, HandlerError> !UnwindSafe for DispatchConn<HandlerCtx, HandlerError>