overclock::core

Trait Channel

Source
pub trait Channel: Send + Sized {
    type Event: Send;
    type Handle: Send + Clone + Shutdown;
    type Inbox: Send + Sync;
    type Metric: Collector + Clone;

    // Required method
    fn channel<T>(
        self,
        scope_id: ScopeId,
    ) -> (Self::Handle, Self::Inbox, AbortRegistration, Option<Self::Metric>, Option<Box<dyn Route<Self::Event>>>);

    // Provided method
    fn type_name() -> Cow<'static, str> { ... }
}
Expand description

Defines a channel which becomes a sender and receiver half

Required Associated Types§

Source

type Event: Send

The channel Event type

Source

type Handle: Send + Clone + Shutdown

The sender half of the channel

Source

type Inbox: Send + Sync

The receiver half of the channel

Source

type Metric: Collector + Clone

Metric Collector

Required Methods§

Source

fn channel<T>( self, scope_id: ScopeId, ) -> (Self::Handle, Self::Inbox, AbortRegistration, Option<Self::Metric>, Option<Box<dyn Route<Self::Event>>>)

Create a sender and receiver of the appropriate types

Provided Methods§

Source

fn type_name() -> Cow<'static, str>

Get this channel’s name

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Channel for Duration

Implementors§

Source§

impl Channel for NullChannel

Source§

impl Channel for TcpListenerStream

Source§

impl<E: Send + 'static> Channel for AbortableUnboundedChannel<E>

Source§

impl<E: Send + 'static, const C: usize> Channel for AbortableBoundedChannel<E, C>

Source§

impl<E: ShutdownEvent + 'static> Channel for UnboundedChannel<E>

Source§

impl<E: ShutdownEvent + 'static, const C: usize> Channel for BoundedChannel<E, C>

Source§

impl<S> Channel for IoChannel<S>
where S: Send + 'static + Sync,

Source§

impl<T, B: Send + Sync + 'static> Channel for Marker<T, B>
where T: Channel,

Source§

impl<const I: u64> Channel for IntervalChannel<I>