pub struct Distributor<T, Codec = Json, const BUFFER: usize = remoc::::rch::mpsc::distributor::Distributor::{constant#0}, const MAX_ITEM_SIZE: usize = remoc::::rch::mpsc::distributor::Distributor::{constant#1}> { /* private fields */ }Expand description
Distributes items of an mpsc channel over multiple receivers.
Distribution is stopped and all subscribers are closed when the distributor is dropped.
Implementations§
Source§impl<T, Codec, const BUFFER: usize, const MAX_ITEM_SIZE: usize> Distributor<T, Codec, BUFFER, MAX_ITEM_SIZE>
impl<T, Codec, const BUFFER: usize, const MAX_ITEM_SIZE: usize> Distributor<T, Codec, BUFFER, MAX_ITEM_SIZE>
Sourcepub async fn subscribe(
&self,
) -> Option<(Receiver<T, Codec, BUFFER, MAX_ITEM_SIZE>, DistributedReceiverHandle)>
pub async fn subscribe( &self, ) -> Option<(Receiver<T, Codec, BUFFER, MAX_ITEM_SIZE>, DistributedReceiverHandle)>
Creates a new subscribed receiver and returns it along with its handle.
Trait Implementations§
Auto Trait Implementations§
impl<T, Codec, const BUFFER: usize, const MAX_ITEM_SIZE: usize> Freeze for Distributor<T, Codec, BUFFER, MAX_ITEM_SIZE>
impl<T, Codec, const BUFFER: usize, const MAX_ITEM_SIZE: usize> RefUnwindSafe for Distributor<T, Codec, BUFFER, MAX_ITEM_SIZE>
impl<T, Codec, const BUFFER: usize, const MAX_ITEM_SIZE: usize> Send for Distributor<T, Codec, BUFFER, MAX_ITEM_SIZE>
impl<T, Codec, const BUFFER: usize, const MAX_ITEM_SIZE: usize> Sync for Distributor<T, Codec, BUFFER, MAX_ITEM_SIZE>
impl<T, Codec, const BUFFER: usize, const MAX_ITEM_SIZE: usize> Unpin for Distributor<T, Codec, BUFFER, MAX_ITEM_SIZE>
impl<T, Codec, const BUFFER: usize, const MAX_ITEM_SIZE: usize> UnwindSafe for Distributor<T, Codec, BUFFER, MAX_ITEM_SIZE>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more