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

    const INSTRUMENTS: usize;

    // Required method
    fn new<IntoString: Into<String>>(multi_name: IntoString) -> Self;
}
Expand description

This trait exists to allow simplifying generic declarations of concrete Multis 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 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<'static, Self::ItemType, 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 Associated Constants§

source

const INSTRUMENTS: usize

The instruments this Multi will collect/report

Required Methods§

source

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

Creates a Multi, which implements the listener pattern, capable of:

  • creating Streams;
  • applying a user-provided processor to the Streams and executing them to depletion – the final Streams may produce a combination of fallible/non-fallible & futures/non-futures events;
  • producing events that are sent to those Streams. multi_name is used for instrumentation purposes, depending on the INSTRUMENT generic argument passed to the Multi struct.

Implementors§

source§

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

source§

const INSTRUMENTS: usize = INSTRUMENTS

§

type ItemType = ItemType

§

type MultiChannelType = MultiChannelType

§

type DerivedItemType = DerivedItemType

§

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