pub trait GenericUni {
    type ItemType: Send + Sync + Debug + 'static;
    type DerivedItemType: Send + Sync + Debug + 'static;
    type UniChannelType: FullDuplexUniChannel<'static, Self::ItemType, Self::DerivedItemType> + Send + Sync + 'static;
    type MutinyStreamType;

    const INSTRUMENTS: usize;

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

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

    struct MyGenericStruct<T: GenericUni> { the_uni: T }
    let the_uni = Uni<Lots,And,Lots<Of,Generic,Arguments>>::new();
    let my_struct = MyGenericStruct { the_uni };
    // see more at `tests/use_cases.rs`

Required Associated Types§

source

type ItemType: Send + Sync + Debug + 'static

The payload type this Uni’s producers will receive

source

type DerivedItemType: Send + Sync + Debug + 'static

The payload type this Uni’s Streams will yield

source

type UniChannelType: FullDuplexUniChannel<'static, Self::ItemType, Self::DerivedItemType> + Send + Sync + 'static

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

source

type MutinyStreamType

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

Required Associated Constants§

source

const INSTRUMENTS: usize

The instruments this Uni will collect/report

Required Methods§

source

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

Creates a Uni, which implements the consumer 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. uni_name is used for instrumentation purposes, depending on the INSTRUMENT generic argument passed to the Uni struct.

Implementors§

source§

impl<ItemType: Send + Sync + Debug + 'static, UniChannelType: FullDuplexUniChannel<'static, ItemType, DerivedItemType> + Send + Sync + 'static, const INSTRUMENTS: usize, DerivedItemType: Send + Sync + Debug> GenericUni for Uni<ItemType, UniChannelType, INSTRUMENTS, DerivedItemType>

source§

const INSTRUMENTS: usize = INSTRUMENTS

§

type ItemType = ItemType

§

type UniChannelType = UniChannelType

§

type DerivedItemType = DerivedItemType

§

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