pub struct ServerDispatcher<T: Transport> { /* private fields */ }Expand description
A dispatcher for a server endpoint.
A server dispatcher receives all of the incoming requests and dispatches them to the server handler. It acts as the message pump for the server.
The dispatcher must be actively polled to receive requests. If the dispatcher is not
run, then requests will not be received.
Implementations§
Source§impl<T: Transport> ServerDispatcher<T>
impl<T: Transport> ServerDispatcher<T>
Sourcepub async fn run<H>(self, handler: H) -> Result<H, ProtocolError<T::Error>>where
H: ServerHandler<T>,
pub async fn run<H>(self, handler: H) -> Result<H, ProtocolError<T::Error>>where
H: ServerHandler<T>,
Runs the server with the provided handler.
Sourcepub async fn run_local<H>(
self,
handler: H,
) -> Result<H, ProtocolError<T::Error>>where
H: LocalServerHandler<T>,
pub async fn run_local<H>(
self,
handler: H,
) -> Result<H, ProtocolError<T::Error>>where
H: LocalServerHandler<T>,
Runs the server with the provided local handler.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for ServerDispatcher<T>
impl<T> !RefUnwindSafe for ServerDispatcher<T>
impl<T> Send for ServerDispatcher<T>
impl<T> Sync for ServerDispatcher<T>
impl<T> Unpin for ServerDispatcher<T>
impl<T> !UnwindSafe for ServerDispatcher<T>
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