pub struct StreamUtils;Expand description
Stream transformation utilities
Implementations§
Source§impl StreamUtils
impl StreamUtils
Sourcepub fn map_events<F, T>(
stream: EventStream,
mapper: F,
) -> Pin<Box<dyn Stream<Item = EventResult<T>> + Send>>
pub fn map_events<F, T>( stream: EventStream, mapper: F, ) -> Pin<Box<dyn Stream<Item = EventResult<T>> + Send>>
Transform a stream of events using a mapping function
Sourcepub fn filter_events<F>(stream: EventStream, predicate: F) -> EventStream
pub fn filter_events<F>(stream: EventStream, predicate: F) -> EventStream
Filter events based on a predicate
Sourcepub fn batch_events(stream: EventStream, batch_size: usize) -> EventBatchStream
pub fn batch_events(stream: EventStream, batch_size: usize) -> EventBatchStream
Batch events into groups of specified size
Sourcepub fn rate_limit(
stream: EventStream,
rate_limiter: Arc<RateLimiter>,
) -> EventStream
pub fn rate_limit( stream: EventStream, rate_limiter: Arc<RateLimiter>, ) -> EventStream
Add rate limiting to an event stream
Sourcepub fn deduplicate(
stream: EventStream,
deduplicator: Arc<EventDeduplicator>,
) -> EventStream
pub fn deduplicate( stream: EventStream, deduplicator: Arc<EventDeduplicator>, ) -> EventStream
Deduplicate events in a stream
Auto Trait Implementations§
impl Freeze for StreamUtils
impl RefUnwindSafe for StreamUtils
impl Send for StreamUtils
impl Sync for StreamUtils
impl Unpin for StreamUtils
impl UnsafeUnpin for StreamUtils
impl UnwindSafe for StreamUtils
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