starlane-space 0.3.19

The 'Space' portion of starlane as opposed to hyperspace. This is where 3rd parties customize Starlane's behavior with WebAssembly and external executables. To develop a starlane driver please look in `./starlane` which holds the 'hyperspace' code (which provides infrastructure)"
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
        }
    }
}