Sha256: 9312f323dd5c3ab98d7790087d150b4168b7836dd7c17e89dca524e01d2d7750

Contents?: true

Size: 609 Bytes

Versions: 1

Compression:

Stored size: 609 Bytes

Contents

use std::collections::HashSet;
use std::str::FromStr;
use std::time::Duration;

use rb_sys::VALUE;

#[derive(Clone, Debug)]
pub struct Configuration {
    pub interval: Duration,
    pub time_mode: TimeMode,
    pub target_ruby_threads: HashSet<VALUE>,
    pub track_new_threads: bool,
}

#[derive(Clone, Debug)]
pub enum TimeMode {
    CpuTime,
    WallTime,
}

impl FromStr for TimeMode {
    type Err = ();

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s {
            "cpu" => Ok(Self::CpuTime),
            "wall" => Ok(Self::WallTime),
            _ => Err(()),
        }
    }
}

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pf2-0.3.0 ext/pf2/src/signal_scheduler/configuration.rs