reactive_mutiny/prelude/
prelude.rs

1//! See [super]
2
3use super::advanced::*;
4pub use crate::{
5    instruments::Instruments,
6    mutiny_stream::MutinyStream,
7    uni::{
8        Uni,
9        GenericUni,
10        unis_close_async,
11    },
12    multi::{
13        Multi,
14        GenericMulti,
15        multis_close_async,
16    },
17    types::*,
18};
19
20
21/// Default 'UniBuilder' for "zero-copying" data that will either be shared around or has a reasonably "big" payload (> 1k)
22pub type UniZeroCopy<InType,
23                     const BUFFER_SIZE: usize,
24                     const MAX_STREAMS: usize,
25                     const INSTRUMENTS: usize = {Instruments::LogsWithMetrics.into()}>
26    = UniZeroCopyAtomic<InType, BUFFER_SIZE, MAX_STREAMS, INSTRUMENTS>;
27
28/// Default `UniBuilder` for "moving" data around -- good for small payloads (< 1k) whose types don't require a custom `Drop` function
29pub type UniMove<InType,
30                 const BUFFER_SIZE: usize,
31                 const MAX_STREAMS: usize,
32                 const INSTRUMENTS: usize = {Instruments::LogsWithMetrics.into()}>
33    = UniMoveFullSync<InType, BUFFER_SIZE, MAX_STREAMS, INSTRUMENTS>;
34
35/// Default `Multi` for those who wants to use `Arc` as the wrapping type for payloads
36pub type MultiArc<ItemType,
37                  const BUFFER_SIZE: usize,
38                  const MAX_STREAMS: usize,
39                  const INSTRUMENTS: usize = {Instruments::LogsWithMetrics.into()}>
40    = MultiAtomicArc<ItemType, BUFFER_SIZE, MAX_STREAMS, INSTRUMENTS>;
41
42/// Default `Multi` for those who want the more performant [OgreArc] as the wrapping type for their payloads
43pub type MultiOgreArc<ItemType,
44                  const BUFFER_SIZE: usize,
45                  const MAX_STREAMS: usize,
46                  const INSTRUMENTS: usize = {Instruments::LogsWithMetrics.into()}>
47    = MultiAtomicOgreArc<ItemType, BUFFER_SIZE, MAX_STREAMS, INSTRUMENTS>;
48