Struct reactive_mutiny::uni::UniBuilder
source · pub struct UniBuilder<InType: 'static + Debug + Sync + Send, UniChannelType: FullDuplexUniChannel<'static, InType, DerivedItemType> + Sync + Send + 'static, const INSTRUMENTS: usize, DerivedItemType: 'static + Debug + Sync + Send> {
pub concurrency_limit: u32,
pub futures_timeout: Duration,
pub instruments: Instruments,
/* private fields */
}Fields§
§concurrency_limit: u32§futures_timeout: Durationif Some, will cause the pipeline to be wrapped with tokio::time::timeout so that an Err will be produced whenever the pipeline takes too much time to process
instruments: InstrumentsInstrumentation this instance gathers / produces
Implementations§
source§impl<InType: 'static + Sync + Send + Debug, UniChannelType: FullDuplexUniChannel<'static, InType, DerivedItemType> + Sync + Send + 'static, const INSTRUMENTS: usize, DerivedItemType: 'static + Debug + Sync + Send> UniBuilder<InType, UniChannelType, INSTRUMENTS, DerivedItemType>
impl<InType: 'static + Sync + Send + Debug, UniChannelType: FullDuplexUniChannel<'static, InType, DerivedItemType> + Sync + Send + 'static, const INSTRUMENTS: usize, DerivedItemType: 'static + Debug + Sync + Send> UniBuilder<InType, UniChannelType, INSTRUMENTS, DerivedItemType>
pub fn new() -> Self
pub fn concurrency_limit(self, concurrency_limit: u32) -> Self
pub fn futures_timeout(self, futures_timeout: Duration) -> Self
pub fn spawn_executor<IntoString: Into<String>, OutItemType: Send + Debug, OutStreamType: Stream<Item = OutType> + Send + 'static, OutType: Future<Output = Result<OutItemType, Box<dyn Error + Send + Sync>>> + Send, ErrVoidAsyncType: Future<Output = ()> + Send + 'static, CloseVoidAsyncType: Future<Output = ()> + Send + 'static>( self, stream_name: IntoString, pipeline_builder: impl FnOnce(MutinyStream<'static, InType, UniChannelType, DerivedItemType>) -> OutStreamType, on_err_callback: impl Fn(Box<dyn Error + Send + Sync>) -> ErrVoidAsyncType + Send + Sync + 'static, on_close_callback: impl Fn(Arc<StreamExecutor<INSTRUMENTS>>) -> CloseVoidAsyncType + Send + Sync + 'static ) -> Arc<Uni<'static, InType, UniChannelType, INSTRUMENTS, DerivedItemType>>
pub fn spawn_fallibles_executor<IntoString: Into<String>, OutItemType: Send + Debug, OutStreamType: Stream<Item = Result<OutItemType, Box<dyn Error + Send + Sync>>> + Send + 'static, CloseVoidAsyncType: Future<Output = ()> + Send + 'static>( self, stream_name: IntoString, pipeline_builder: impl FnOnce(MutinyStream<'static, InType, UniChannelType, DerivedItemType>) -> OutStreamType, on_err_callback: impl Fn(Box<dyn Error + Send + Sync>) + Send + Sync + 'static, on_close_callback: impl Fn(Arc<StreamExecutor<INSTRUMENTS>>) -> CloseVoidAsyncType + Send + Sync + 'static ) -> Arc<Uni<'static, InType, UniChannelType, INSTRUMENTS, DerivedItemType>>
pub fn spawn_futures_executor<IntoString: Into<String>, OutItemType: Send + Debug, OutStreamType: Stream<Item = OutType> + Send + 'static, OutType: Future<Output = OutItemType> + Send, CloseVoidAsyncType: Future<Output = ()> + Send + 'static>( self, stream_name: IntoString, pipeline_builder: impl FnOnce(MutinyStream<'static, InType, UniChannelType, DerivedItemType>) -> OutStreamType, on_close_callback: impl Fn(Arc<StreamExecutor<INSTRUMENTS>>) -> CloseVoidAsyncType + Send + Sync + 'static ) -> Arc<Uni<'static, InType, UniChannelType, INSTRUMENTS, DerivedItemType>>
pub fn spawn_non_futures_non_fallibles_executor<IntoString: Into<String>, OutItemType: Send + Debug, OutStreamType: Stream<Item = OutItemType> + Send + 'static, CloseVoidAsyncType: Future<Output = ()> + Send + 'static>( self, stream_name: IntoString, pipeline_builder: impl FnOnce(MutinyStream<'static, InType, UniChannelType, DerivedItemType>) -> OutStreamType, on_close_callback: impl FnOnce(Arc<StreamExecutor<INSTRUMENTS>>) -> CloseVoidAsyncType + Send + Sync + 'static ) -> Arc<Uni<'static, InType, UniChannelType, INSTRUMENTS, DerivedItemType>>
Auto Trait Implementations§
impl<InType, UniChannelType, const INSTRUMENTS: usize, DerivedItemType> RefUnwindSafe for UniBuilder<InType, UniChannelType, INSTRUMENTS, DerivedItemType>where DerivedItemType: RefUnwindSafe, InType: RefUnwindSafe, UniChannelType: RefUnwindSafe,
impl<InType, UniChannelType, const INSTRUMENTS: usize, DerivedItemType> Send for UniBuilder<InType, UniChannelType, INSTRUMENTS, DerivedItemType>
impl<InType, UniChannelType, const INSTRUMENTS: usize, DerivedItemType> Sync for UniBuilder<InType, UniChannelType, INSTRUMENTS, DerivedItemType>
impl<InType, UniChannelType, const INSTRUMENTS: usize, DerivedItemType> Unpin for UniBuilder<InType, UniChannelType, INSTRUMENTS, DerivedItemType>where DerivedItemType: Unpin, InType: Unpin, UniChannelType: Unpin,
impl<InType, UniChannelType, const INSTRUMENTS: usize, DerivedItemType> UnwindSafe for UniBuilder<InType, UniChannelType, INSTRUMENTS, DerivedItemType>where DerivedItemType: UnwindSafe, InType: UnwindSafe, UniChannelType: UnwindSafe,
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more