diff options
author | Cara Salter <cara@devcara.com> | 2022-06-09 12:16:54 -0400 |
---|---|---|
committer | Cara Salter <cara@devcara.com> | 2022-06-09 12:16:54 -0400 |
commit | bddaf3af81b836ac8d25199f154fc59a95848dab (patch) | |
tree | 85df763660d2e65b87cb83520b5dafb8cc62c04f /src/planet.rs | |
parent | 137ec4c34aa962b11148cfad443a4c88035e3d87 (diff) | |
download | solarlib-bddaf3af81b836ac8d25199f154fc59a95848dab.tar.gz solarlib-bddaf3af81b836ac8d25199f154fc59a95848dab.zip |
planet: Implement Display for Health
Diffstat (limited to 'src/planet.rs')
-rw-r--r-- | src/planet.rs | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/planet.rs b/src/planet.rs index b2aa221..210de5a 100644 --- a/src/planet.rs +++ b/src/planet.rs @@ -1,4 +1,4 @@ -use std::{convert::TryFrom, sync::Arc}; +use std::{convert::TryFrom, sync::Arc, fmt::Display}; use virt::{domain::{Domain, DomainState}}; use serde::{Serialize, Deserialize}; @@ -169,6 +169,12 @@ pub enum Health { GuestSuspended = 7 } +impl Display for Health { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + write!(f, "{:?}", self) + } +} + impl TryFrom<u32> for Health { type Error = Error; fn try_from(value: u32) -> Result<Self, Self::Error> { |