16 lines
285 B
Text
16 lines
285 B
Text
#[derive(Debug)]
|
|
pub enum State {
|
|
Start,
|
|
Transient,
|
|
Closed,
|
|
}
|
|
|
|
impl From<&'a str> for State {
|
|
fn from(s: &'a str) -> Self {
|
|
match s {
|
|
"start" => State::Start,
|
|
"closed" => State::Closed,
|
|
_ => unreachable!(),
|
|
}
|
|
}
|
|
}
|