mirror of
https://github.com/kata-containers/kata-containers.git
synced 2025-05-03 14:07:24 +00:00
kata-ctl: Implement Display trait for GuestProtection enum
Implement Display for enum to display in env output. Signed-off-by: Archana Shinde <archana.m.shinde@intel.com>
This commit is contained in:
parent
94a00f9346
commit
7565b33568
@ -8,6 +8,7 @@
|
||||
use anyhow::{anyhow, Result};
|
||||
use reqwest::header::{CONTENT_TYPE, USER_AGENT};
|
||||
use serde::{Deserialize, Serialize};
|
||||
use std::fmt;
|
||||
use thiserror::Error;
|
||||
|
||||
#[cfg(any(target_arch = "x86_64"))]
|
||||
@ -147,6 +148,19 @@ pub enum GuestProtection {
|
||||
Se,
|
||||
}
|
||||
|
||||
impl fmt::Display for GuestProtection {
|
||||
fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
|
||||
match self {
|
||||
GuestProtection::Tdx => write!(f, "tdx"),
|
||||
GuestProtection::Sev => write!(f, "sev"),
|
||||
GuestProtection::Snp => write!(f, "snp"),
|
||||
GuestProtection::Pef => write!(f, "pef"),
|
||||
GuestProtection::Se => write!(f, "se"),
|
||||
GuestProtection::NoProtection => write!(f, "none"),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(dead_code)]
|
||||
#[derive(Error, Debug)]
|
||||
pub enum ProtectionError {
|
||||
|
Loading…
Reference in New Issue
Block a user