Dispatcher

Struct Dispatcher 

Source
pub struct Dispatcher<T: Send> { /* private fields */ }
Expand description

Dispatch coordinator for adding additional clocked channels.

Implementations§

Source§

impl<T: Send> Dispatcher<T>

Source

pub fn new<S1: Into<String>, S2: Into<String>>( &self, sender: S1, receiver: S2, ) -> (ClockedSender<T>, ClockedReceiver<T>)

Creates a new named, synchronous, bounded, clocked channel managed by this dispatcher.

The given receiver and sender names must be unique for this dispatch.

The ClockedReceiver will block until a message or a new timestamp becomes available.

The receiver’s incoming channel has an internal buffer on which messages will be queued. Its size is inherited from the dispatch bound. When this buffer becomes full, future messages from the dispatcher will block waiting for the buffer to open up. Note that a buffer size of 0 is valid, but its behavior differs from that of synchronous Rust channels. Because the dispatcher sits between the sender and the receiver, a bound of 0 will not guarantee a “rendezvous” between the sender and the receiver, but rather between the sender and the dispatcher (and subsequently, the dispatcher and the receiver).

Auto Trait Implementations§

§

impl<T> Freeze for Dispatcher<T>

§

impl<T> RefUnwindSafe for Dispatcher<T>

§

impl<T> Send for Dispatcher<T>

§

impl<T> Sync for Dispatcher<T>

§

impl<T> Unpin for Dispatcher<T>

§

impl<T> UnwindSafe for Dispatcher<T>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.