starlane 0.3.21

Starlane -- An Orchestration and Infrastructure Framework for WebAssembly Components (https://starlane.io) This packaged manages `HyperSpace` which provides infrastructure for `Space` Apis (WebAssembly & external programs meant to provide custom behaviors in Starlane), This package references the `starlane-space` package and reuses of it to run the infrastructure and it also contains mechanisms (Drivers) for extending the Starlane Type system
Documentation
use crate::space::wave::WaitTime;

// measured in seconds
#[derive(Clone)]
pub struct Timeouts {
    pub high: u64,
    pub med: u64,
    pub low: u64,
}

impl Timeouts {
    pub fn from<W: Into<WaitTime>>(&self, wait: W) -> u64 {
        match wait.into() {
            WaitTime::High => self.high,
            WaitTime::Med => self.med,
            WaitTime::Low => self.low,
        }
    }

    pub fn from_wait(&self, wait: &WaitTime) -> u64 {
        match wait {
            WaitTime::High => self.high,
            WaitTime::Med => self.med,
            WaitTime::Low => self.low,
        }
    }
}

impl Default for Timeouts {
    fn default() -> Self {
        Self {
            high: 5 * 60, // 5 minutes
            med: 1 * 60,  // 1 minute
            low: 15,      // 15 seconds
        }
    }
}