2026-01-08 18:01:20 +01:00
|
|
|
#[derive(Debug, Clone)]
|
2026-01-01 21:58:42 +01:00
|
|
|
pub struct S3Item {
|
|
|
|
|
pub key: String,
|
|
|
|
|
pub is_folder: bool,
|
|
|
|
|
pub folder_name: Option<String>,
|
|
|
|
|
pub size: Option<i64>,
|
|
|
|
|
pub last_modified: Option<String>,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
impl std::fmt::Display for S3Item {
|
|
|
|
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
|
|
|
|
let item_type = if self.is_folder { "[MAPPA]" } else { "[FÁJL]" };
|
|
|
|
|
let size_str = if let Some(size) = self.size {
|
|
|
|
|
format!("{} bytes", size)
|
|
|
|
|
} else {
|
|
|
|
|
"-".to_string()
|
|
|
|
|
};
|
|
|
|
|
write!(f, "{} {} (méret: {})", item_type, self.key, size_str)
|
|
|
|
|
}
|
|
|
|
|
}
|