Struct wasm_rs_shared_channel::spsc::Receiver[][src]

pub struct Receiver<T>(pub SharedChannel<T>)
where
    T: Shareable
;

Receiver part of the channel

Implementations

impl<T> Receiver<T> where
    T: Shareable
[src]

pub fn recv(&self, timeout: Option<Duration>) -> Result<Option<T>, JsValue>[src]

Receives a value from the channel

If timeout is None, if there is no message, it'll immediately return Ok(None).

If timeout is Some(duration) it will return Ok(Some(value)) if there was a value, otherwise, it'll return Ok(None) when timed out.

There's no way to specify an infinite timeout. Instead, a sufficiently large std::time::Duration should be used.

Auto Trait Implementations

impl<T> RefUnwindSafe for Receiver<T> where
    T: RefUnwindSafe
[src]

impl<T> !Send for Receiver<T>[src]

impl<T> !Sync for Receiver<T>[src]

impl<T> Unpin for Receiver<T> where
    T: Unpin
[src]

impl<T> UnwindSafe for Receiver<T> where
    T: UnwindSafe
[src]

Blanket Implementations

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

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

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

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.