1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
use serde::{Deserialize, Serialize};
#[derive(Clone, Debug, Default, Deserialize, Serialize)]
#[serde(rename_all = "PascalCase")]
pub struct AllocFileInfo {
pub name: Option<String>,
pub is_dir: Option<bool>,
pub size: Option<i64>,
pub file_mode: Option<String>,
pub mod_time: Option<String>,
pub content_type: Option<String>,
}
impl AllocFileInfo{
pub fn is_empty(&self) -> bool{
self.size.map_or(false, |value| value <= 1)
}
}