Struct rxrust::observable::ThrowObservable
source · [−]pub struct ThrowObservable<Err>(_);
Trait Implementations
sourceimpl<Err: Clone> Clone for ThrowObservable<Err>
impl<Err: Clone> Clone for ThrowObservable<Err>
sourcefn clone(&self) -> ThrowObservable<Err>
fn clone(&self) -> ThrowObservable<Err>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'o, Err> LocalObservable<'o> for ThrowObservable<Err>
impl<'o, Err> LocalObservable<'o> for ThrowObservable<Err>
type Unsub = SingleSubscription
fn actual_subscribe<O>(self, _observer: O) -> Self::Unsub where
O: Observer<Item = Self::Item, Err = Self::Err> + 'o,
sourceimpl<Err> Observable for ThrowObservable<Err>
impl<Err> Observable for ThrowObservable<Err>
type Item = ()
type Err = Err
sourcefn 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
sourcefn 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
sourcefn 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
sourcefn 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 Read more
sourcefn all<F>(
self,
pred: F
) -> DefaultIfEmptyOp<TakeOp<FilterOp<MapOp<Self, F>, fn(_: &bool) -> bool>>> where
F: Fn(Self::Item) -> bool,
fn all<F>(
self,
pred: F
) -> DefaultIfEmptyOp<TakeOp<FilterOp<MapOp<Self, F>, fn(_: &bool) -> bool>>> where
F: Fn(Self::Item) -> bool,
Determine whether all items emitted by an Observable meet some criteria
sourcefn 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
sourcefn 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
sourcefn 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.
sourcefn 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
sourcefn flat_map<Inner, B, F>(self, f: F) -> FlatMapOp<Self, Inner, F> where
Inner: Observable<Item = B, Err = Self::Err>,
F: Fn(Self::Item) -> Inner,
fn flat_map<Inner, B, F>(self, f: F) -> FlatMapOp<Self, Inner, F> where
Inner: Observable<Item = B, Err = Self::Err>,
F: Fn(Self::Item) -> Inner,
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. Read more
sourcefn group_by<D, Item, Key>(self, discr: D) -> GroupByOp<Self, D> where
D: FnMut(&Item) -> Key,
fn group_by<D, Item, Key>(self, discr: D) -> GroupByOp<Self, D> where
D: FnMut(&Item) -> Key,
Groups items emitted by the source Observable into Observables. Each emitted Observable emits items matching the key returned by the discriminator function. Read more
sourcefn map<B, F>(self, f: F) -> MapOp<Self, F> where
F: FnMut(Self::Item) -> B,
fn map<B, F>(self, f: F) -> MapOp<Self, F> where
F: FnMut(Self::Item) -> B,
Creates a new stream which calls a closure on each element and uses its return as the value. Read more
sourcefn merge<S>(self, o: S) -> MergeOp<Self, S> where
S: Observable<Item = Self::Item, Err = Self::Err>,
fn merge<S>(self, o: S) -> MergeOp<Self, S> where
S: Observable<Item = Self::Item, Err = Self::Err>,
combine two Observables into one by merging their emissions Read more
sourcefn 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
sourcefn filter<F>(self, filter: F) -> FilterOp<Self, F> where
F: Fn(&Self::Item) -> bool,
fn filter<F>(self, filter: F) -> FilterOp<Self, F> where
F: Fn(&Self::Item) -> bool,
Emit only those items from an Observable that pass a predicate test Read more
sourcefn filter_map<F, SourceItem, Item>(self, f: F) -> FilterMapOp<Self, F> where
F: FnMut(SourceItem) -> Option<Item>,
fn filter_map<F, SourceItem, Item>(self, f: F) -> FilterMapOp<Self, F> where
F: FnMut(SourceItem) -> Option<Item>,
The closure must return an Option
sourcefn box_it<O: IntoBox<Self>>(self) -> BoxOp<O> where
BoxOp<O>: Observable<Item = Self::Item, Err = Self::Err>,
fn box_it<O: IntoBox<Self>>(self) -> BoxOp<O> where
BoxOp<O>: Observable<Item = Self::Item, Err = Self::Err>,
box an observable to a safety object and convert it to a simple type
BoxOp
, which only care Item
and Err
Observable emitted. Read more
sourcefn skip(self, count: u32) -> SkipOp<Self>
fn skip(self, count: u32) -> SkipOp<Self>
Ignore the first count
values emitted by the source Observable. Read more
sourcefn skip_until<F>(self, predicate: F) -> SkipUntilOp<Self, F> where
F: FnMut(&Self::Item) -> bool,
fn skip_until<F>(self, predicate: F) -> SkipUntilOp<Self, F> where
F: FnMut(&Self::Item) -> bool,
Ignore the values emitted by the source Observable until the predicate
returns true for the value. Read more
sourcefn skip_while<F>(self, callback: F) -> SkipWhileOp<Self, F> where
F: FnMut(&Self::Item) -> bool,
fn skip_while<F>(self, callback: F) -> SkipWhileOp<Self, F> where
F: FnMut(&Self::Item) -> bool,
Ignore values while result of a callback is true. Read more
sourcefn 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 more
sourcefn 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 more
sourcefn 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 more
sourcefn take_while<F>(self, callback: F) -> TakeWhileOp<Self, F> where
F: FnMut(&Self::Item) -> bool,
fn take_while<F>(self, callback: F) -> TakeWhileOp<Self, F> where
F: FnMut(&Self::Item) -> bool,
Emits values while result of an callback is true. Read more
sourcefn take_while_inclusive<F>(self, callback: F) -> TakeWhileOp<Self, F> where
F: FnMut(&Self::Item) -> bool,
fn take_while_inclusive<F>(self, callback: F) -> TakeWhileOp<Self, F> where
F: FnMut(&Self::Item) -> bool,
Emits values while result of an callback is true and the last one that causes the callback to return false. Read more
sourcefn 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 more
sourcefn 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
sourcefn scan_initial<OutputItem, BinaryOp>(
self,
initial_value: OutputItem,
binary_op: BinaryOp
) -> ScanOp<Self, BinaryOp, OutputItem> where
BinaryOp: Fn(OutputItem, Self::Item) -> OutputItem,
OutputItem: Clone,
fn scan_initial<OutputItem, BinaryOp>(
self,
initial_value: OutputItem,
binary_op: BinaryOp
) -> ScanOp<Self, BinaryOp, OutputItem> where
BinaryOp: Fn(OutputItem, Self::Item) -> OutputItem,
OutputItem: Clone,
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
sourcefn scan<OutputItem, BinaryOp>(
self,
binary_op: BinaryOp
) -> ScanOp<Self, BinaryOp, OutputItem> where
BinaryOp: Fn(OutputItem, Self::Item) -> OutputItem,
OutputItem: Default + Clone,
fn scan<OutputItem, BinaryOp>(
self,
binary_op: BinaryOp
) -> ScanOp<Self, BinaryOp, OutputItem> where
BinaryOp: Fn(OutputItem, Self::Item) -> OutputItem,
OutputItem: Default + Clone,
Works like scan_initial
but starts with a
value defined by a Default
trait for the first argument binary_op
operator operates on. Read more
sourcefn reduce_initial<OutputItem, BinaryOp>(
self,
initial: OutputItem,
binary_op: BinaryOp
) -> ReduceOp<Self, BinaryOp, OutputItem> where
BinaryOp: Fn(OutputItem, Self::Item) -> OutputItem,
OutputItem: Clone,
fn reduce_initial<OutputItem, BinaryOp>(
self,
initial: OutputItem,
binary_op: BinaryOp
) -> ReduceOp<Self, BinaryOp, OutputItem> where
BinaryOp: Fn(OutputItem, Self::Item) -> OutputItem,
OutputItem: Clone,
Apply a function to each item emitted by an observable, sequentially, and emit the final value, after source observable completes. Read more
sourcefn reduce<OutputItem, BinaryOp>(
self,
binary_op: BinaryOp
) -> DefaultIfEmptyOp<LastOp<ScanOp<Self, BinaryOp, OutputItem>, OutputItem>> where
BinaryOp: Fn(OutputItem, Self::Item) -> OutputItem,
OutputItem: Default + Clone,
fn reduce<OutputItem, BinaryOp>(
self,
binary_op: BinaryOp
) -> DefaultIfEmptyOp<LastOp<ScanOp<Self, BinaryOp, OutputItem>, OutputItem>> where
BinaryOp: Fn(OutputItem, Self::Item) -> OutputItem,
OutputItem: Default + Clone,
Works like reduce_initial
but starts with
a value defined by a Default
trait for the first argument f
operator operates on. Read more
sourcefn max(self) -> MinMaxOp<Self, Self::Item> where
Self::Item: Clone + Send + PartialOrd<Self::Item>,
fn max(self) -> MinMaxOp<Self, Self::Item> where
Self::Item: Clone + Send + PartialOrd<Self::Item>,
Emits the item from the source observable that had the maximum value. Read more
sourcefn min(self) -> MinMaxOp<Self, Self::Item> where
Self::Item: Clone + Send + PartialOrd<Self::Item>,
fn min(self) -> MinMaxOp<Self, Self::Item> where
Self::Item: Clone + Send + PartialOrd<Self::Item>,
Emits the item from the source observable that had the minimum value. Read more
sourcefn sum(self) -> SumOp<Self, Self::Item> where
Self::Item: Clone + Default + Add<Self::Item, Output = Self::Item>,
fn sum(self) -> SumOp<Self, Self::Item> where
Self::Item: Clone + Default + Add<Self::Item, Output = Self::Item>,
Calculates the sum of numbers emitted by an source observable and emits this sum when source completes. Read more
sourcefn 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
sourcefn average(self) -> AverageOp<Self, Self::Item> where
Self::Item: Clone + Send + Default + Add<Self::Item, Output = Self::Item> + Mul<f64, Output = Self::Item>,
fn average(self) -> AverageOp<Self, Self::Item> where
Self::Item: Clone + Send + Default + Add<Self::Item, Output = Self::Item> + Mul<f64, Output = Self::Item>,
Calculates the sum of numbers emitted by an source observable and emits this sum when source completes. Read more
sourcefn 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. Read more
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()
Read more
sourcefn 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
. Read more
fn delay_at<SD>(self, at: Instant, scheduler: SD) -> DelayOp<Self, SD>
sourcefn 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
sourcefn 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
sourcefn 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. Read more
sourcefn 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
sourcefn 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. Read more
sourcefn distinct_key<F>(self, key: F) -> DistinctKeyOp<Self, F>
fn distinct_key<F>(self, key: F) -> DistinctKeyOp<Self, F>
Variant of distinct that takes a key selector.
sourcefn distinct_until_changed(self) -> DistinctUntilChangedOp<Self>
fn distinct_until_changed(self) -> DistinctUntilChangedOp<Self>
Only emit when the current value is different than the last
sourcefn distinct_until_key_changed<F>(
self,
key: F
) -> DistinctUntilKeyChangedOp<Self, F>
fn distinct_until_key_changed<F>(
self,
key: F
) -> DistinctUntilKeyChangedOp<Self, F>
Variant of distinct_until_changed that takes a key selector.
sourcefn 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
sourcefn with_latest_from<U>(self, other: U) -> WithLatestFromOp<Self, U> where
U: Observable,
fn with_latest_from<U>(self, other: U) -> WithLatestFromOp<Self, U> where
U: Observable,
Combines the source Observable with other Observables to create an Observable whose values are calculated from the latest values of each, only when the source emits. Read more
sourcefn 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
sourcefn 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
sourcefn 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
sourcefn 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
sourcefn combine_latest<O, BinaryOp, OutputItem>(
self,
other: O,
binary_op: BinaryOp
) -> CombineLatestOp<Self, O, BinaryOp> where
O: Observable<Err = Self::Err>,
BinaryOp: FnMut(Self::Item, O::Item) -> OutputItem,
fn combine_latest<O, BinaryOp, OutputItem>(
self,
other: O,
binary_op: BinaryOp
) -> CombineLatestOp<Self, O, BinaryOp> where
O: Observable<Err = Self::Err>,
BinaryOp: FnMut(Self::Item, O::Item) -> OutputItem,
Emits item which is combining latest items from two observables. Read more
sourcefn start_with<B>(self, values: Vec<B>) -> StartWithOp<Self, B>
fn start_with<B>(self, values: Vec<B>) -> StartWithOp<Self, B>
Returns an observable that, at the moment of subscription, will synchronously emit all values provided to this operator, then subscribe to the source and mirror all of its emissions to subscribers. Read more
sourcefn pairwise(self) -> PairwiseOp<Self>
fn pairwise(self) -> PairwiseOp<Self>
Groups pairs of consecutive emissions together and emits them as an pair of two values. Read more
type Unsub = SingleSubscription
fn actual_subscribe<O>(self, _observer: O) -> Self::Unsub where
O: Observer<Item = Self::Item, Err = Self::Err> + Send + Sync + 'static,
Convert to a thread-safe mode.
Auto Trait Implementations
impl<Err> RefUnwindSafe for ThrowObservable<Err> where
Err: RefUnwindSafe,
impl<Err> Send for ThrowObservable<Err> where
Err: Send,
impl<Err> Sync for ThrowObservable<Err> where
Err: Sync,
impl<Err> Unpin for ThrowObservable<Err> where
Err: Unpin,
impl<Err> UnwindSafe for ThrowObservable<Err> where
Err: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'a, T> BoxClone<'a> for T where
T: 'a + BoxObservable<'a> + Clone,
impl<'a, T> BoxClone<'a> for T where
T: 'a + BoxObservable<'a> + Clone,
fn box_clone(
&self
) -> Box<dyn BoxClone<'a, Item = <T as BoxObservable<'a>>::Item, Err = <T as BoxObservable<'a>>::Err> + 'a, Global>
sourceimpl<'a, T> BoxObservable<'a> for T where
T: 'a + LocalObservable<'a>,
<T as LocalObservable<'a>>::Unsub: 'static,
impl<'a, T> BoxObservable<'a> for T where
T: 'a + LocalObservable<'a>,
<T as LocalObservable<'a>>::Unsub: 'static,
type Item = <T as Observable>::Item
type Err = <T as Observable>::Err
fn box_subscribe(
self: Box<T, Global>,
observer: Box<dyn Observer<Err = <T as BoxObservable<'a>>::Err, Item = <T as BoxObservable<'a>>::Item> + 'a, Global>
) -> Box<dyn SubscriptionLike + 'static, Global>
fn box_clone(
&self
) -> Box<dyn SharedBoxClone<Err = <T as SharedBoxObservable>::Err, Item = <T as SharedBoxObservable>::Item> + 'static, Global>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more