[][src]Struct crossbeam_requests::Responder

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

A Responder listens to requests of a specific type and responds back to the Requester

Methods

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

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

Poll if the Responder has received any requests. It then returns a Request which you need to call respond() on before dropping. Not calling respond is considered a programmer error and will result in a panic

This call is blocking TODO: add try_poll

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

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

Auto Trait Implementations

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

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

Blanket Implementations

impl<T> From for T[src]

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

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.