[][src]Struct crossbeam_requests::RequestReceiver

pub struct RequestReceiver<Req, Res> { /* fields omitted */ }

A RequestReceiver listens to requests. Requests are a tuple of a message and a ResponseSender which is used to respond back to the ResponseReceiver

Methods

impl<Req, Res> RequestReceiver<Req, Res>[src]

pub fn poll(&self) -> Result<(Req, ResponseSender<Res>), RequestError>[src]

Poll if the RequestReceiver has received any requests. The poll returns a tuple of the request message and a ResponseSender which is used to respond back to the ResponseReceiver.

NOTE: It is considered an programmer error to not send a response with the ResponseSender

This call is blocking TODO: add a poll equivalent which is not blocking and/or has a timeout

pub fn poll_loop<F>(&self, f: F) where
    F: FnMut(Req, ResponseSender<Res>), 
[src]

A shorthand for running poll with a closure for as long as there is one or more RequestSenders alive referencing this RequestReceiver

Auto Trait Implementations

impl<Req, Res> Unpin for RequestReceiver<Req, Res> where
    Req: Unpin

impl<Req, Res> Send for RequestReceiver<Req, Res> where
    Req: Send,
    Res: Send

impl<Req, Res> Sync for RequestReceiver<Req, Res> where
    Req: Send,
    Res: Send

impl<Req, Res> UnwindSafe for RequestReceiver<Req, Res>

impl<Req, Res> RefUnwindSafe for RequestReceiver<Req, Res>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]