Skip to content

stdlib/channelView source ↗

channel

7 items · generated by scribe fromstdlib/channel.fd· synced 2026-11-15

stdlib/channel7 items

Contents

CHAN_CLOSED

Sentinel value returned by channel_recv when the channel is closed and empty. This is i64::MIN + 1 (0x8000000000000001).

pub fn CHAN_CLOSED() -> i64 {

Returns: i64

Defined at line 29


channel_create

Create a bounded channel with the given capacity. Returns a channel handle (i64) that can be shared across threads.

pub fn channel_create(capacity: i64) -> i64 {

Parameters:

  • capacity: i64

Returns: i64

Defined at line 35


channel_send

Send a value on the channel. Blocks if the channel is full. Returns true if the value was sent, false if the channel is closed.

pub fn channel_send(ch: i64, value: i64) -> bool {

Parameters:

  • ch: i64
  • value: i64

Returns: bool

Defined at line 41


channel_recv

Receive a value from the channel. Blocks if the channel is empty. Returns the value, or CHAN_CLOSED if the channel is closed and empty.

pub fn channel_recv(ch: i64) -> i64 {

Parameters:

  • ch: i64

Returns: i64

Defined at line 47


channel_try_recv

Try to receive a value from the channel without blocking. Returns the value if available, CHAN_CLOSED if closed and empty, or CHAN_PENDING if the channel is empty but not closed.

pub fn channel_try_recv(ch: i64) -> i64 {

Parameters:

  • ch: i64

Returns: i64

Defined at line 54


channel_close

Close the channel. After closing, no more values can be sent. Pending values can still be received. Receivers wake up and get CHAN_CLOSED when the buffer is drained.

pub fn channel_close(ch: i64) -> void {

Parameters:

  • ch: i64

Returns: void

Defined at line 61


channel_is_closed

Check if the channel is closed.

pub fn channel_is_closed(ch: i64) -> bool {

Parameters:

  • ch: i64

Returns: bool

Defined at line 66


Generated by scribe, the Fides documentation generator