Struct wasm_rs_shared_channel::spsc::Receiver [−][src]
Receiver part of the channel
Implementations
impl<T> Receiver<T> where
T: Shareable,
[src]
T: Shareable,
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]
T: RefUnwindSafe,
impl<T> !Send for Receiver<T>
[src]
impl<T> !Sync for Receiver<T>
[src]
impl<T> Unpin for Receiver<T> where
T: Unpin,
[src]
T: Unpin,
impl<T> UnwindSafe for Receiver<T> where
T: UnwindSafe,
[src]
T: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
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.
pub 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>,