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

    const INSTRUMENTS: usize;

    // Required methods
    fn new<IntoString: Into<String>>(uni_name: IntoString) -> Self;
    fn to_uni(
        self
    ) -> Uni<Self::ItemType, Self::UniChannelType, INSTRUMENTS, Self::DerivedItemType>;
}
Expand description

This trait exists to allow simplifying generic declarations of concrete Uni 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<ItemType = Self::ItemType, DerivedItemType = 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

source

fn to_uni( self ) -> Uni<Self::ItemType, Self::UniChannelType, INSTRUMENTS, Self::DerivedItemType>

Implementors§

source§

impl<ItemType: Send + Sync + Debug + 'static, UniChannelType: FullDuplexUniChannel<ItemType = ItemType, DerivedItemType = DerivedItemType> + Send + Sync + 'static, const INSTRUMENTS: usize, DerivedItemType: Send + Sync + Debug + 'static> GenericUni<INSTRUMENTS> 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>