sdk_common/src/models/shared_process.rs
2024-03-25 14:24:33 +01:00

36 lines
946 B
Rust

use serde::{Deserialize, Serialize};
use super::key_encryption::KeyEncryption;
#[derive(Debug, Serialize, Deserialize, Default, Clone, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct Process {
pub hash: String,
pub key: KeyEncryption,
pub role_process_sp_address_list: Vec<String>,
}
impl Process {
pub fn new(
hash: String,
key: KeyEncryption,
role_process_sp_address_list: Vec<String>,
) -> Self {
Process {
hash,
key,
role_process_sp_address_list,
}
}
// display_info method
pub fn display_info(&self) {
println!("Process:");
println!("Hash: {}", self.hash);
println!("Key Encryption:");
self.key.display_info(); // Assuming KeyEncryption has a display_info method
println!(
"Role Process SP Address List: {:?}",
self.role_process_sp_address_list
);
}
}