1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
//! PickUp related enums and implementations
#[derive(Debug, Serialize, FromPrimitive, ToPrimitive, Hash, Clone)]
pub enum PickUp {
    RegularlyScheduled = 0,
    NotAvailable = 1,
    MustArrangeWithAgency = 2,
    MustCoordinateWithDriver = 3,
}

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