pub struct Server<S, R, E>(/* private fields */);Expand description
Implementations§
Source§impl<S, R, E> Server<S, R, E>
impl<S, R, E> Server<S, R, E>
Sourcepub fn wait(&self) -> Result<(S, ReplyContext<R, E>), Error<E>>
pub fn wait(&self) -> Result<(S, ReplyContext<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
Err(Error::ClientsDisappeared) indicates that the queue is empty and
all the client end-points have been dropped.
Sourcepub fn try_pop(&self) -> Result<Option<(S, ReplyContext<R, E>)>, Error<E>>
pub fn try_pop(&self) -> Result<Option<(S, ReplyContext<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<(S, ReplyContext<R, E>), Error<E>>
pub async fn async_wait(&self) -> Result<(S, ReplyContext<R, E>), Error<E>>
Same as Server::wait(), but for use in an async context.
Auto Trait Implementations§
impl<S, R, E> Freeze for Server<S, R, E>
impl<S, R, E> !RefUnwindSafe for Server<S, R, E>
impl<S, R, E> Send for Server<S, R, E>
impl<S, R, E> Sync for Server<S, R, E>
impl<S, R, E> Unpin for Server<S, R, E>
impl<S, R, E> !UnwindSafe for Server<S, R, E>
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