pub struct Server<P, S, R, E>(/* private fields */);Expand description
Implementations§
Source§impl<P, S, R, E> Server<P, S, R, E>
impl<P, S, R, E> Server<P, S, R, E>
Sourcepub fn wait(&self) -> Result<MsgType<P, S, R, E>, Error<E>>
pub fn wait(&self) -> Result<MsgType<P, S, R, E>, Error<E>>
Block and wait, indefinitely, for an incoming message from a
Client.
Returns the message sent by the client and a reply context. The server
must call ReplyContext::reply() on the reply context to pass a return
value to the client.
§Errors
Error::ClientsDisappeared indicates that the queue is empty and
all the client end-points have been dropped.
Sourcepub fn try_pop(&self) -> Result<Option<MsgType<P, S, R, E>>, Error<E>>
pub fn try_pop(&self) -> Result<Option<MsgType<P, S, R, E>>, Error<E>>
Take next next message off queue or return None is queue is empty.
§Errors
Error::ClientsDisappeared indicates that the queue is empty and
all the client end-points have been dropped.
Sourcepub async fn async_wait(&self) -> Result<MsgType<P, S, R, E>, Error<E>>
pub async fn async_wait(&self) -> Result<MsgType<P, S, R, E>, Error<E>>
Same as Server::wait(), but for use in an async context.