client-api: Allow the DeviceId to turn into a DeviceIdOrAllDevices

This commit is contained in:
Damir Jelić 2021-05-12 15:04:47 +02:00 committed by Jonas Platte
parent d971b668ec
commit 3bdead1cf2

View File

@ -32,6 +32,12 @@ impl Display for DeviceIdOrAllDevices {
}
}
impl From<DeviceIdBox> for DeviceIdOrAllDevices {
fn from(d: DeviceIdBox) -> Self {
DeviceIdOrAllDevices::DeviceId(d)
}
}
impl TryFrom<&str> for DeviceIdOrAllDevices {
type Error = &'static str;
fn try_from(device_id_or_all_devices: &str) -> Result<Self, Self::Error> {