1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
//! DropOff related enums and implementations

#[derive(Debug, Serialize, FromPrimitive, ToPrimitive, Hash, Clone)]
pub enum DropOff {
    RegularlyScheduled = 0,
    NotAvailable = 1,
    MustArrangeWithAgency = 2,
    MustCoordinateWithDriver = 3,
}

impl DropOff {
    pub fn from_string(input: &str) -> DropOff {
        match input {
            "RegularlyScheduled" => DropOff::RegularlyScheduled,
            "NotAvailable" => DropOff::NotAvailable,
            "MustArrangeWithAgency" => DropOff::MustArrangeWithAgency,
            "MustCoordinateWithDriver" => DropOff::MustCoordinateWithDriver,
            _ => DropOff::RegularlyScheduled,
        }
    }
}