Trait GenericMulti

Source
pub trait GenericMulti<const INSTRUMENTS: usize> {
    type ItemType: Debug + Sync + Send + 'static;
    type DerivedItemType: Debug + Sync + Send + 'static;
    type MultiChannelType: FullDuplexMultiChannel<ItemType = Self::ItemType, DerivedItemType = Self::DerivedItemType> + Sync + Send;
    type MutinyStreamType;

    const INSTRUMENTS: usize;

    // Required methods
    fn new<IntoString>(multi_name: IntoString) -> Self
       where IntoString: Into<String>;
    fn to_multi(
        self,
    ) -> Multi<Self::ItemType, Self::MultiChannelType, INSTRUMENTS, Self::DerivedItemType>;
}
Expand description

This trait exists to allow simplifying generic declarations of concrete Multi types. See also [GenericUni].
Usage:

    struct MyGenericStruct<T: GenericMulti> { the_multi: T }
    let the_multi = Multi<Lots,And,Lots<Of,Generic,Arguments>>::new();
    let my_struct = MyGenericStruct { the_multi };

Required Associated Constants§

Source

const INSTRUMENTS: usize

The instruments this Multi will collect/report

Required Associated Types§

Source

type ItemType: Debug + Sync + Send + 'static

The payload type this Multi’s producers will receive

Source

type DerivedItemType: Debug + Sync + Send + 'static

The payload type this Multi’s Streams will yield

Source

type MultiChannelType: FullDuplexMultiChannel<ItemType = Self::ItemType, DerivedItemType = Self::DerivedItemType> + Sync + Send

The channel through which payloads will travel from producers to listeners (see Multi for more info)

Source

type MutinyStreamType

Defined as MutinyStream<'static, ItemType, MultiChannelType, DerivedItemType>,
the concrete type for the Stream of DerivedItemTypes to be given to listeners

Required Methods§

Source

fn new<IntoString>(multi_name: IntoString) -> Self
where IntoString: Into<String>,

Source

fn to_multi( self, ) -> Multi<Self::ItemType, Self::MultiChannelType, INSTRUMENTS, Self::DerivedItemType>

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.

Implementors§

Source§

impl<ItemType, MultiChannelType, const INSTRUMENTS: usize, DerivedItemType> GenericMulti<INSTRUMENTS> for Multi<ItemType, MultiChannelType, INSTRUMENTS, DerivedItemType>
where ItemType: Debug + Send + Sync + 'static, MultiChannelType: FullDuplexMultiChannel<ItemType = ItemType, DerivedItemType = DerivedItemType> + Sync + Send + 'static, DerivedItemType: Debug + Sync + Send + 'static,

Source§

const INSTRUMENTS: usize = INSTRUMENTS

Source§

type ItemType = ItemType

Source§

type MultiChannelType = MultiChannelType

Source§

type DerivedItemType = DerivedItemType

Source§

type MutinyStreamType = MutinyStream<'static, ItemType, MultiChannelType, DerivedItemType>