Crate crossbeam_ring_channel

Crate crossbeam_ring_channel 

Source
Expand description

Ring-buffer channels built alongside crossbeam-channel, plus a Select wrapper that can mix ring receivers with standard crossbeam-channel operations.

use crossbeam_ring_channel::{ring_bounded, select};

let (tx, rx) = ring_bounded(2);
tx.send(1).unwrap();

select! {
    recv(rx) -> msg => {
        assert_eq!(msg.unwrap(), 1);
    },
}

Macros§

select
Selects over ring receivers and crossbeam-channel send/recv operations.
select_biased
Selects like select!, but prefers earlier arms when multiple are ready.
select_internal
Internal macro used by select! and select_biased!.

Structs§

RingReceiver
Receiver half of the ring-buffer channel.
RingSender
Sender half of the ring-buffer channel.
Select
Selection builder that mirrors crossbeam-channel’s Select API, but supports ring receivers.
SelectedOperation
Result of a selection.

Traits§

SelectRecv
Trait implemented by receiver types that can be registered with Select.
SelectSend
Trait implemented by sender types that can be registered with Select.
SelectedRecv
Trait implemented by receiver types that can complete a selected receive.
SelectedSend
Trait implemented by sender types that can complete a selected send.

Functions§

ring_bounded
Creates a ring-buffer channel with the given capacity.