1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
//! Interrupts for communicating with the VM from the outside and also for
//! letting the VM communicate with the outside

use std::str::FromStr;

#[derive(Serialize, Deserialize, Debug, Clone)]
pub enum Signal {
    FlushFrame,
}

impl FromStr for Signal {
    type Err = &'static str;

    fn from_str(s: &str) -> Result<Self, Self::Err> {
        match s {
            "%flush_frame%" => Ok(Signal::FlushFrame),
            _ => Err("unable to parse signal"),
        }
    }
}