[−][src]Struct crossbeam_requests::RequestReceiver
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]
F: FnMut(Req, ResponseSender<Res>),
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,
Req: Unpin,
impl<Req, Res> Send for RequestReceiver<Req, Res> where
Req: Send,
Res: Send,
Req: Send,
Res: Send,
impl<Req, Res> Sync for RequestReceiver<Req, Res> where
Req: Send,
Res: Send,
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]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,