slash-files-rs 0.1.0

Configurable Rust file browser with HTMX UI, JSON API, previews, batch operations, and multi-framework adapters.
Documentation
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub enum FileKind {
    File,
    Directory,
    Symlink,
    Other,
}

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct FileEntry {
    pub name: String,
    pub relative_path: String,
    pub parent_relative_path: String,
    pub kind: FileKind,
    pub is_directory: bool,
    pub in_batch: bool,
    pub size_bytes: u64,
    pub modified_unix_seconds: Option<u64>,
    pub size_label: String,
    pub modified_label: String,
    pub permissions_label: String,
}

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct Breadcrumb {
    pub name: String,
    pub path: String,
}

#[derive(Clone, Debug, PartialEq, Eq, Default)]
pub struct DirectoryListing {
    pub current_path: String,
    pub current_path_display: String,
    pub breadcrumbs: Vec<Breadcrumb>,
    pub entries: Vec<FileEntry>,
    pub total_entries: usize,
}

#[derive(Clone, Debug, PartialEq, Eq, Default)]
pub struct SearchResults {
    pub query: String,
    pub entries: Vec<FileEntry>,
    pub total_matches: usize,
    pub is_truncated: bool,
}

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct BatchEntry {
    pub relative_path: String,
    pub display_path: String,
}

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct DownloadLauncherEntry {
    pub relative_path: String,
    pub download_url: String,
}

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct StorageUsage {
    pub used_bytes: u64,
    pub available_bytes: u64,
    pub total_bytes: u64,
    pub used_percent: u8,
    pub used_label: String,
    pub available_label: String,
    pub total_label: String,
}

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MountOption {
    pub id: String,
    pub name: String,
    pub is_active: bool,
    pub is_available: bool,
    pub error_message: Option<String>,
    pub switch_url: String,
}

#[derive(Clone, Debug, PartialEq, Eq)]
pub struct MoveTargetOption {
    pub id: String,
    pub name: String,
}