Files
cloudbackup/src/models/s3_items.rs
T

21 lines
602 B
Rust
Raw Normal View History

2026-01-01 21:58:42 +01:00
#[derive(Debug)]
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)
}
}