#[derive(Debug)]
pub struct Instance {
pub name: String,
pub ip: String,
pub state: String,
pub image: String,
pub image_hash: String,
pub disk_usage: String,
pub total_disk: String,
pub memory_usage: String,
pub memory_total: String,
pub load: String,
}
impl Instance {
pub fn new() -> Instance {
Instance {
name: "".to_string(),
ip: "".to_string(),
state: "".to_string(),
image: "".to_string(),
image_hash: "".to_string(),
disk_usage: "".to_string(),
total_disk: "".to_string(),
memory_usage: "".to_string(),
memory_total: "".to_string(),
load: "".to_string(),
}
}
pub fn is_empty(&self) -> bool {
self.name.is_empty()
&& self.ip.is_empty()
&& self.state.is_empty()
&& self.image.is_empty()
&& self.image_hash.is_empty()
&& self.disk_usage.is_empty()
&& self.total_disk.is_empty()
&& self.memory_usage.is_empty()
&& self.memory_total.is_empty()
&& self.load.is_empty()
}
}