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

The sending half of a synchronous (bounded) channel. More...

Public Member Functions

auto send (T msg) -> Result< empty, T >
 Sends a value on this channel, blocking if the buffer is full.
 
auto try_send (T msg) -> Result< empty, T >
 Attempts to send a value without blocking.
 

Detailed Description

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

The sending half of a synchronous (bounded) channel.

Blocks when the buffer is full until space becomes available.

Template Parameters
TThe type of values sent through the channel.

Member Function Documentation

◆ send()

template<typename T >
auto rstd::sync::mpsc::SyncSender< T >::send ( T msg) -> Result<empty, T>
inlineexport

Sends a value on this channel, blocking if the buffer is full.

Parameters
msgThe message to send.
Returns
Err(msg) if the receiver has disconnected.

◆ try_send()

template<typename T >
auto rstd::sync::mpsc::SyncSender< T >::try_send ( T msg) -> Result<empty, T>
inlineexport

Attempts to send a value without blocking.

Parameters
msgThe message to send.
Returns
Err(msg) if the buffer is full or the receiver has disconnected.

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