Trait reactive_mutiny::uni::GenericUni
source · 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§
sourcetype ItemType: Send + Sync + Debug + 'static
type ItemType: Send + Sync + Debug + 'static
The payload type this Uni’s producers will receive
sourcetype DerivedItemType: Send + Sync + Debug + 'static
type DerivedItemType: Send + Sync + Debug + 'static
The payload type this Uni’s Streams will yield
sourcetype UniChannelType: FullDuplexUniChannel<ItemType = Self::ItemType, DerivedItemType = Self::DerivedItemType> + Send + Sync + 'static
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)
sourcetype MutinyStreamType
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§
sourceconst INSTRUMENTS: usize
const INSTRUMENTS: usize
The instruments this Uni will collect/report
Required Methods§
sourcefn new<IntoString: Into<String>>(uni_name: IntoString) -> Self
fn new<IntoString: Into<String>>(uni_name: IntoString) -> Self
See Uni::new()