rstd 0.1.0
Loading...
Searching...
No Matches
rstd::sync::mpsc::Receiver< T > Class Template Referenceexport
module rstd

The receiving half of a channel, used to receive messages sent by Sender or SyncSender. More...

Public Member Functions

auto recv () -> Result< T, empty >
 Blocks the current thread until a message is received or the channel is disconnected.
 
auto try_recv () -> Result< T, empty >
 Attempts to receive a message without blocking.
 

Detailed Description

template<typename T>
class rstd::sync::mpsc::Receiver< T >

The receiving half of a channel, used to receive messages sent by Sender or SyncSender.

Template Parameters
TThe type of values received through the channel.

Member Function Documentation

◆ recv()

template<typename T >
auto rstd::sync::mpsc::Receiver< T >::recv ( ) -> Result<T, empty>
inlineexport

Blocks the current thread until a message is received or the channel is disconnected.

Returns
Ok(value) on success, or Err on disconnection.

◆ try_recv()

template<typename T >
auto rstd::sync::mpsc::Receiver< T >::try_recv ( ) -> Result<T, empty>
inlineexport

Attempts to receive a message without blocking.

Returns
Ok(value) if a message was available, or Err if the channel is empty or disconnected.

The documentation for this class was generated from the following file: