[][src]Trait rxrust::ops::count::Count

pub trait Count {
    fn count<Item>(self) -> CountOp<Self, Item>
    where
        Self: Sized
, { ... } }

Provided methods

fn count<Item>(self) -> CountOp<Self, Item> where
    Self: Sized

Emits the number of items emitted by a source observable when this source completes.

The output type of this operator is fixed to usize.

Emits zero when source completed as an and empty sequence. Emits error when source observable emits it.

Examples

use rxrust::prelude::*;
use rxrust::ops::Count;

observable::from_iter(vec!['1', '7', '3', '0', '4'])
  .count()
  .subscribe(|v| println!("{}", v));

// print log:
// 5
Loading content...

Implementors

impl<O> Count for O[src]

Loading content...