pub struct PullBuilder<St, K, F, Q = K>{ /* private fields */ }
Expand description
The builder forwards each stream item according to its key to a destination receiver.
Implementations§
Source§impl<St, K, Q, F> PullBuilder<St, K, F, Q>
impl<St, K, Q, F> PullBuilder<St, K, F, Q>
Sourcepub fn new<B>(stream: St, buf_size: B, key_fn: F) -> Self
pub fn new<B>(stream: St, buf_size: B, key_fn: F) -> Self
Creates the builder.
The buf_size
sets the channel size for each registered receiver.
The key_fn
is used to compute the key for each input item.
Sourcepub fn register(&mut self, key: K) -> Option<RecvStream<'static, St::Item>>
pub fn register(&mut self, key: K) -> Option<RecvStream<'static, St::Item>>
Creates a receiver binding to the key
.
If the key
is already registered, it returns None
.
Sourcepub fn build(self) -> RecvStream<'static, St::Item>
pub fn build(self) -> RecvStream<'static, St::Item>
Finish the builder and start forwarding items to receivers.
It returns a special leaking receiver that accepts items which key is not registered or the destination receiver is closed.
Auto Trait Implementations§
impl<St, K, F, Q> Freeze for PullBuilder<St, K, F, Q>
impl<St, K, F, Q> RefUnwindSafe for PullBuilder<St, K, F, Q>
impl<St, K, F, Q> Send for PullBuilder<St, K, F, Q>
impl<St, K, F, Q> Sync for PullBuilder<St, K, F, Q>
impl<St, K, F, Q> Unpin for PullBuilder<St, K, F, Q>
impl<St, K, F, Q> UnwindSafe for PullBuilder<St, K, F, Q>
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