1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
use heim_common::prelude::*;

use crate::{sys, Pid};

/// Returns stream which yields [Pid].
///
/// Consequent calls are not guaranteed to return pids in the same order.
///
/// [Pid]: type.Pid.html
pub fn pids() -> impl Stream<Item=Pid, Error=Error> {
    sys::pids()
}

/// Returns future which checks is process with passed `pid` is exists.
pub fn pid_exists(pid: Pid) -> impl Future<Item=bool, Error=Error> {
    sys::pid_exists(pid)
}