pub struct ZipOp<A, B> { /* private fields */ }
Expand description
An Observable that combines from two other two Observables.
This struct is created by the zip method on Observable. See its documentation for more.
Trait Implementations§
Source§impl<'a, A, B> LocalObservable<'a> for ZipOp<A, B>
impl<'a, A, B> LocalObservable<'a> for ZipOp<A, B>
type Unsub = LocalSubscription
fn actual_subscribe<O: Observer<Item = Self::Item, Err = Self::Err> + 'a>( self, subscriber: Subscriber<O, LocalSubscription>, ) -> Self::Unsub
Source§impl<A, B> Observable for ZipOp<A, B>
impl<A, B> Observable for ZipOp<A, B>
type Item = (<A as Observable>::Item, <B as Observable>::Item)
type Err = <A as Observable>::Err
Source§fn first_or(self, default: Self::Item) -> DefaultIfEmptyOp<TakeOp<Self>>
fn first_or(self, default: Self::Item) -> DefaultIfEmptyOp<TakeOp<Self>>
emit only the first item emitted by an Observable
Source§fn last_or(
self,
default: Self::Item,
) -> DefaultIfEmptyOp<LastOp<Self, Self::Item>>
fn last_or( self, default: Self::Item, ) -> DefaultIfEmptyOp<LastOp<Self, Self::Item>>
Emit only the last final item emitted by a source observable or a
default item given. Read more
Source§fn element_at(self, nth: u32) -> TakeOp<SkipOp<Self>>
fn element_at(self, nth: u32) -> TakeOp<SkipOp<Self>>
Emit only item n (0-indexed) emitted by an Observable
Source§fn ignore_elements(self) -> FilterOp<Self, fn(&Self::Item) -> bool>
fn ignore_elements(self) -> FilterOp<Self, fn(&Self::Item) -> bool>
Do not emit any items from an Observable but mirror its termination
notification
Source§fn all<F>(
self,
pred: F,
) -> DefaultIfEmptyOp<TakeOp<FilterOp<MapOp<Self, F>, fn(&bool) -> bool>>>
fn all<F>( self, pred: F, ) -> DefaultIfEmptyOp<TakeOp<FilterOp<MapOp<Self, F>, fn(&bool) -> bool>>>
Determine whether all items emitted by an Observable meet some criteria
Source§fn contains(self, target: Self::Item) -> ContainsOp<Self, Self::Item>
fn contains(self, target: Self::Item) -> ContainsOp<Self, Self::Item>
Determine whether an Observable emits a particular item or not
Source§fn last(self) -> LastOp<Self, Self::Item>
fn last(self) -> LastOp<Self, Self::Item>
Emits only last final item emitted by a source observable. Read more
Source§fn finalize<F>(self, f: F) -> FinalizeOp<Self, F>where
F: FnMut(),
fn finalize<F>(self, f: F) -> FinalizeOp<Self, F>where
F: FnMut(),
Call a function when observable completes, errors or is unsubscribed from.
Source§fn flatten<Inner, A>(self) -> FlattenOp<Self, Inner>where
Inner: Observable<Item = A, Err = Self::Err>,
fn flatten<Inner, A>(self) -> FlattenOp<Self, Inner>where
Inner: Observable<Item = A, Err = Self::Err>,
Creates an Observable that combines all the emissions from Observables
that get emitted from an Observable. Read more
Source§fn flat_map<Inner, B, F>(self, f: F) -> FlatMapOp<Self, Inner, F>
fn flat_map<Inner, B, F>(self, f: F) -> FlatMapOp<Self, Inner, F>
Applies given function to each item emitted by this Observable, where
that function returns an Observable that itself emits items. It then
merges the emissions of these resulting Observables, emitting these
merged results as its own sequence.
Source§fn group_by<D, Item, Key>(self, discr: D) -> GroupByOp<Self, D>
fn group_by<D, Item, Key>(self, discr: D) -> GroupByOp<Self, D>
Groups items emited by the source Observable into Observables.
Each emited Observable emits items matching the key returned
by the discriminator function. Read more
Source§fn map<B, F>(self, f: F) -> MapOp<Self, F>
fn map<B, F>(self, f: F) -> MapOp<Self, F>
Creates a new stream which calls a closure on each element and uses
its return as the value.
Source§fn merge<S>(self, o: S) -> MergeOp<Self, S>
fn merge<S>(self, o: S) -> MergeOp<Self, S>
combine two Observables into one by merging their emissions Read more
Source§fn merge_all(self, concurrent: usize) -> MergeAllOp<Self>
fn merge_all(self, concurrent: usize) -> MergeAllOp<Self>
Converts a higher-order Observable into a first-order Observable which
concurrently delivers all values that are emitted on the inner
Observables. Read more
Source§fn filter<F>(self, filter: F) -> FilterOp<Self, F>
fn filter<F>(self, filter: F) -> FilterOp<Self, F>
Emit only those items from an Observable that pass a predicate test Read more
Source§fn filter_map<F, SourceItem, Item>(self, f: F) -> FilterMapOp<Self, F>
fn filter_map<F, SourceItem, Item>(self, f: F) -> FilterMapOp<Self, F>
The closure must return an Option. filter_map creates an iterator which
calls this closure on each element. If the closure returns Some(element),
then that element is returned. If the closure returns None, it will try
again, and call the closure on the next element, seeing if it will return
Some. Read more
Source§fn box_it<O: IntoBox<Self>>(self) -> BoxOp<O>
fn box_it<O: IntoBox<Self>>(self) -> BoxOp<O>
box an observable to a safety object and convert it to a simple type
BoxOp
, which only care Item
and Err
Observable emitted. Read moreSource§fn skip(self, count: u32) -> SkipOp<Self>
fn skip(self, count: u32) -> SkipOp<Self>
Ignore the first
count
values emitted by the source Observable. Read moreSource§fn skip_while<F>(self, callback: F) -> SkipWhileOp<Self, F>
fn skip_while<F>(self, callback: F) -> SkipWhileOp<Self, F>
Ignore values while result of a callback is true. Read more
Source§fn skip_last(self, count: usize) -> SkipLastOp<Self>
fn skip_last(self, count: usize) -> SkipLastOp<Self>
Ignore the last
count
values emitted by the source Observable. Read moreSource§fn take(self, count: u32) -> TakeOp<Self>
fn take(self, count: u32) -> TakeOp<Self>
Emits only the first
count
values emitted by the source Observable. Read moreSource§fn take_until<T>(self, notifier: T) -> TakeUntilOp<Self, T>
fn take_until<T>(self, notifier: T) -> TakeUntilOp<Self, T>
Emits the values emitted by the source Observable until a
notifier
Observable emits a value. Read moreSource§fn take_while<F>(self, callback: F) -> TakeWhileOp<Self, F>
fn take_while<F>(self, callback: F) -> TakeWhileOp<Self, F>
Emits values while result of an callback is true. Read more
Source§fn take_last(self, count: usize) -> TakeLastOp<Self>
fn take_last(self, count: usize) -> TakeLastOp<Self>
Emits only the last
count
values emitted by the source Observable. Read moreSource§fn sample<O>(self, sampling: O) -> SampleOp<Self, O>where
O: Observable,
fn sample<O>(self, sampling: O) -> SampleOp<Self, O>where
O: Observable,
Emits item it has most recently emitted since the previous sampling Read more
Source§fn scan_initial<OutputItem, BinaryOp>(
self,
initial_value: OutputItem,
binary_op: BinaryOp,
) -> ScanOp<Self, BinaryOp, OutputItem>
fn scan_initial<OutputItem, BinaryOp>( self, initial_value: OutputItem, binary_op: BinaryOp, ) -> ScanOp<Self, BinaryOp, OutputItem>
The Scan operator applies a function to the first item emitted by the
source observable and then emits the result of that function as its
own first emission. It also feeds the result of the function back into
the function along with the second item emitted by the source observable
in order to generate its second emission. It continues to feed back its
own subsequent emissions along with the subsequent emissions from the
source Observable in order to create the rest of its sequence. Read more
Source§fn scan<OutputItem, BinaryOp>(
self,
binary_op: BinaryOp,
) -> ScanOp<Self, BinaryOp, OutputItem>
fn scan<OutputItem, BinaryOp>( self, binary_op: BinaryOp, ) -> ScanOp<Self, BinaryOp, OutputItem>
Works like
scan_initial
but starts with a
value defined by a Default
trait for the first argument binary_op
operator operates on. Read moreSource§fn reduce_initial<OutputItem, BinaryOp>(
self,
initial: OutputItem,
binary_op: BinaryOp,
) -> ReduceOp<Self, BinaryOp, OutputItem>
fn reduce_initial<OutputItem, BinaryOp>( self, initial: OutputItem, binary_op: BinaryOp, ) -> ReduceOp<Self, BinaryOp, OutputItem>
Apply a function to each item emitted by an observable, sequentially,
and emit the final value, after source observable completes. Read more
Source§fn reduce<OutputItem, BinaryOp>(
self,
binary_op: BinaryOp,
) -> DefaultIfEmptyOp<LastOp<ScanOp<Self, BinaryOp, OutputItem>, OutputItem>>
fn reduce<OutputItem, BinaryOp>( self, binary_op: BinaryOp, ) -> DefaultIfEmptyOp<LastOp<ScanOp<Self, BinaryOp, OutputItem>, OutputItem>>
Works like
reduce_initial
but starts with
a value defined by a Default
trait for the first argument f
operator operates on. Read moreSource§fn max(self) -> MinMaxOp<Self, Self::Item>
fn max(self) -> MinMaxOp<Self, Self::Item>
Emits the item from the source observable that had the maximum value. Read more
Source§fn min(self) -> MinMaxOp<Self, Self::Item>
fn min(self) -> MinMaxOp<Self, Self::Item>
Emits the item from the source observable that had the minimum value. Read more
Source§fn sum(self) -> SumOp<Self, Self::Item>
fn sum(self) -> SumOp<Self, Self::Item>
Calculates the sum of numbers emitted by an source observable and emits
this sum when source completes. Read more
Source§fn count(self) -> CountOp<Self, Self::Item>
fn count(self) -> CountOp<Self, Self::Item>
Emits the number of items emitted by a source observable when this source
completes. Read more
Source§fn average(self) -> AverageOp<Self, Self::Item>
fn average(self) -> AverageOp<Self, Self::Item>
Calculates the sum of numbers emitted by an source observable and emits
this sum when source completes. Read more
Source§fn publish<Subject: Default>(self) -> ConnectableObservable<Self, Subject>
fn publish<Subject: Default>(self) -> ConnectableObservable<Self, Subject>
Returns a ConnectableObservable. A ConnectableObservable Observable
resembles an ordinary Observable, except that it does not begin emitting
items when it is subscribed to, but only when the Connect operator is
applied to it. In this way you can wait for all intended observers to
subscribe to the Observable before the Observable begins emitting items.
Returns a new Observable that multicast (shares) the original
Observable. As long as there is at least one Subscriber this
Observable will be subscribed and emitting data. When all subscribers
have unsubscribed it will unsubscribe from the source Observable.
Because the Observable is multicasting it makes the stream
hot
.
This is an alias for publish().ref_count()
Source§fn delay<SD>(self, dur: Duration, scheduler: SD) -> DelayOp<Self, SD>
fn delay<SD>(self, dur: Duration, scheduler: SD) -> DelayOp<Self, SD>
Delays the emission of items from the source Observable by a given timeout
or until a given
Instant
.fn delay_at<SD>(self, at: Instant, scheduler: SD) -> DelayOp<Self, SD>
Source§fn subscribe_on<SD>(self, scheduler: SD) -> SubscribeOnOP<Self, SD>
fn subscribe_on<SD>(self, scheduler: SD) -> SubscribeOnOP<Self, SD>
Specify the Scheduler on which an Observable will operate Read more
Source§fn observe_on<SD>(self, scheduler: SD) -> ObserveOnOp<Self, SD>
fn observe_on<SD>(self, scheduler: SD) -> ObserveOnOp<Self, SD>
Re-emits all notifications from source Observable with specified
scheduler. Read more
Source§fn debounce<SD>(self, duration: Duration, scheduler: SD) -> DebounceOp<Self, SD>
fn debounce<SD>(self, duration: Duration, scheduler: SD) -> DebounceOp<Self, SD>
Emits a value from the source Observable only after a particular time span
has passed without another source emission.
Source§fn throttle_time<SD>(
self,
duration: Duration,
edge: ThrottleEdge,
scheduler: SD,
) -> ThrottleTimeOp<Self, SD>
fn throttle_time<SD>( self, duration: Duration, edge: ThrottleEdge, scheduler: SD, ) -> ThrottleTimeOp<Self, SD>
Emits a value from the source Observable, then ignores subsequent source
values for duration milliseconds, then repeats this process. Read more
Source§fn distinct(self) -> DistinctOp<Self>
fn distinct(self) -> DistinctOp<Self>
Returns an Observable that emits all items emitted by the source
Observable that are distinct by comparison from previous items.
Source§fn zip<U>(self, other: U) -> ZipOp<Self, U>where
U: Observable,
fn zip<U>(self, other: U) -> ZipOp<Self, U>where
U: Observable,
‘Zips up’ two observable into a single observable of pairs. Read more
Source§fn default_if_empty(self, default_value: Self::Item) -> DefaultIfEmptyOp<Self>
fn default_if_empty(self, default_value: Self::Item) -> DefaultIfEmptyOp<Self>
Emits default value if Observable completed with empty result Read more
Source§fn buffer_with_count(self, count: usize) -> BufferWithCountOp<Self>
fn buffer_with_count(self, count: usize) -> BufferWithCountOp<Self>
Buffers emitted values of type T in a Vec and
emits that Vec as soon as the buffer’s size equals
the given count.
On complete, if the buffer is not empty,
it will be emitted.
On error, the buffer will be discarded. Read more
Source§fn buffer_with_time<S>(
self,
time: Duration,
scheduler: S,
) -> BufferWithTimeOp<Self, S>
fn buffer_with_time<S>( self, time: Duration, scheduler: S, ) -> BufferWithTimeOp<Self, S>
Buffers emitted values of type T in a Vec and
emits that Vec periodically. Read more
Source§fn buffer_with_count_and_time<S>(
self,
count: usize,
time: Duration,
scheduler: S,
) -> BufferWithCountOrTimerOp<Self, S>
fn buffer_with_count_and_time<S>( self, count: usize, time: Duration, scheduler: S, ) -> BufferWithCountOrTimerOp<Self, S>
Buffers emitted values of type T in a Vec and
emits that Vec either if the buffer’s size equals count, or
periodically. This operator combines the functionality of
buffer_with_count and buffer_with_time. Read more
type Unsub = SharedSubscription
fn actual_subscribe<O: Observer<Item = Self::Item, Err = Self::Err> + Sync + Send + 'static>( self, subscriber: Subscriber<O, SharedSubscription>, ) -> Self::Unsub
Convert to a thread-safe mode.
Auto Trait Implementations§
impl<A, B> Freeze for ZipOp<A, B>
impl<A, B> RefUnwindSafe for ZipOp<A, B>where
A: RefUnwindSafe,
B: RefUnwindSafe,
impl<A, B> Send for ZipOp<A, B>
impl<A, B> Sync for ZipOp<A, B>
impl<A, B> Unpin for ZipOp<A, B>
impl<A, B> UnwindSafe for ZipOp<A, B>where
A: UnwindSafe,
B: 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
Source§impl<'a, T> BoxClone<'a> for Twhere
T: BoxObservable<'a> + Clone + 'a,
impl<'a, T> BoxClone<'a> for Twhere
T: BoxObservable<'a> + Clone + 'a,
fn box_clone( &self, ) -> Box<dyn BoxClone<'a, Err = <T as BoxObservable<'a>>::Err, Item = <T as BoxObservable<'a>>::Item> + 'a>
Source§impl<'a, T> BoxObservable<'a> for Twhere
T: LocalObservable<'a> + 'a,
impl<'a, T> BoxObservable<'a> for Twhere
T: LocalObservable<'a> + 'a,
type Item = <T as Observable>::Item
type Err = <T as Observable>::Err
fn box_subscribe( self: Box<T>, subscriber: Subscriber<Box<dyn Observer<Err = <T as BoxObservable<'a>>::Err, Item = <T as BoxObservable<'a>>::Item> + 'a>, LocalSubscription>, ) -> Box<dyn SubscriptionLike>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
fn box_clone( &self, ) -> Box<dyn SharedBoxClone<Item = <T as SharedBoxObservable>::Item, Err = <T as SharedBoxObservable>::Err>>
Source§impl<'a, S, N, E, C> SubscribeAll<'a, N, E, C> for Swhere
S: LocalObservable<'a>,
N: FnMut(<S as Observable>::Item) + 'a,
E: FnMut(<S as Observable>::Err) + 'a,
<S as Observable>::Err: 'a,
<S as Observable>::Item: 'a,
C: FnMut() + 'a,
impl<'a, S, N, E, C> SubscribeAll<'a, N, E, C> for Swhere
S: LocalObservable<'a>,
N: FnMut(<S as Observable>::Item) + 'a,
E: FnMut(<S as Observable>::Err) + 'a,
<S as Observable>::Err: 'a,
<S as Observable>::Item: 'a,
C: FnMut() + 'a,
Source§type Unsub = <S as LocalObservable<'a>>::Unsub
type Unsub = <S as LocalObservable<'a>>::Unsub
A type implementing
SubscriptionLike
Source§fn subscribe_all(
self,
next: N,
error: E,
complete: C,
) -> SubscriptionWrapper<<S as SubscribeAll<'a, N, E, C>>::Unsub>
fn subscribe_all( self, next: N, error: E, complete: C, ) -> SubscriptionWrapper<<S as SubscribeAll<'a, N, E, C>>::Unsub>
Invokes an execution of an Observable and registers Observer handlers for
notifications it will emit. Read more
Source§impl<'a, S, N, C> SubscribeComplete<'a, N, C> for Swhere
S: LocalObservable<'a, Err = ()>,
C: FnMut() + 'a,
N: FnMut(<S as Observable>::Item) + 'a,
<S as Observable>::Item: 'a,
impl<'a, S, N, C> SubscribeComplete<'a, N, C> for Swhere
S: LocalObservable<'a, Err = ()>,
C: FnMut() + 'a,
N: FnMut(<S as Observable>::Item) + 'a,
<S as Observable>::Item: 'a,
Source§type Unsub = <S as LocalObservable<'a>>::Unsub
type Unsub = <S as LocalObservable<'a>>::Unsub
A type implementing
SubscriptionLike
Source§fn subscribe_complete(
self,
next: N,
complete: C,
) -> SubscriptionWrapper<<S as SubscribeComplete<'a, N, C>>::Unsub>where
<S as Observable>::Item: 'a,
fn subscribe_complete(
self,
next: N,
complete: C,
) -> SubscriptionWrapper<<S as SubscribeComplete<'a, N, C>>::Unsub>where
<S as Observable>::Item: 'a,
Invokes an execution of an Observable and registers Observer handlers for
notifications it will emit.
Source§impl<'a, S, N, E> SubscribeErr<'a, N, E> for Swhere
S: LocalObservable<'a>,
N: FnMut(<S as Observable>::Item) + 'a,
E: FnMut(<S as Observable>::Err) + 'a,
<S as Observable>::Err: 'a,
<S as Observable>::Item: 'a,
impl<'a, S, N, E> SubscribeErr<'a, N, E> for Swhere
S: LocalObservable<'a>,
N: FnMut(<S as Observable>::Item) + 'a,
E: FnMut(<S as Observable>::Err) + 'a,
<S as Observable>::Err: 'a,
<S as Observable>::Item: 'a,
Source§type Unsub = <S as LocalObservable<'a>>::Unsub
type Unsub = <S as LocalObservable<'a>>::Unsub
A type implementing
SubscriptionLike
Source§fn subscribe_err(
self,
next: N,
error: E,
) -> SubscriptionWrapper<<S as SubscribeErr<'a, N, E>>::Unsub>
fn subscribe_err( self, next: N, error: E, ) -> SubscriptionWrapper<<S as SubscribeErr<'a, N, E>>::Unsub>
Invokes an execution of an Observable and registers Observer handlers for
notifications it will emit. Read more
Source§impl<'a, S, N> SubscribeNext<'a, N> for Swhere
S: LocalObservable<'a, Err = ()>,
N: FnMut(<S as Observable>::Item) + 'a,
<S as Observable>::Item: 'a,
impl<'a, S, N> SubscribeNext<'a, N> for Swhere
S: LocalObservable<'a, Err = ()>,
N: FnMut(<S as Observable>::Item) + 'a,
<S as Observable>::Item: 'a,
Source§type Unsub = <S as LocalObservable<'a>>::Unsub
type Unsub = <S as LocalObservable<'a>>::Unsub
A type implementing
SubscriptionLike
Source§fn subscribe(
self,
next: N,
) -> SubscriptionWrapper<<S as SubscribeNext<'a, N>>::Unsub>
fn subscribe( self, next: N, ) -> SubscriptionWrapper<<S as SubscribeNext<'a, N>>::Unsub>
Invokes an execution of an Observable and registers Observer handlers for
notifications it will emit.