slash_files/lib.rs
1//! `slash-files-rs` is an embeddable file browser for Rust web backends.
2//!
3//! It provides:
4//!
5//! - a polished HTMX-based file browser UI
6//! - a JSON API for browsing, search, downloads, deletes, and transfers
7//! - multi-mount support with mount health reporting
8//! - built-in previews for common browser-renderable file types
9//! - extension hooks for custom preview rendering
10//! - feature-gated adapters for Axum, Actix-web, and Poem
11//!
12//! Enable one or more adapter features depending on your host framework:
13//!
14//! - `axum`
15//! - `actix-web`
16//! - `poem`
17//!
18//! # Example
19//!
20//! ```
21//! # #[cfg(feature = "axum")] {
22//! use slash_files::{AxumFileServer, FileServerConfig};
23//!
24//! let file_server = AxumFileServer::new(
25//! FileServerConfig::new("./data").with_mount_path("/files"),
26//! );
27//!
28//! let _ = file_server;
29//! # }
30//! ```
31//!
32pub mod config;
33pub mod fs;
34pub mod model;
35pub mod preview;
36pub mod templates;
37pub mod web;
38
39pub use config::{Branding, FeatureFlags, FileMount, FileServerConfig, RoutePaths, Theme};
40pub use fs::{DeleteSummary, FileAsset, FileService, FileServiceError, MoveSummary};
41pub use model::{
42 BatchEntry, Breadcrumb, DirectoryListing, DownloadLauncherEntry, FileEntry, FileKind,
43 MountOption, MoveTargetOption, SearchResults, StorageUsage,
44};
45pub use preview::{PreviewDocument, PreviewHandler, PreviewRegistry, PreviewRequest};
46#[cfg(feature = "actix-web")]
47pub use web::actix_web::FileServer as ActixFileServer;
48#[cfg(feature = "axum")]
49pub use web::axum::FileServer;
50#[cfg(feature = "axum")]
51pub use web::axum::FileServer as AxumFileServer;
52#[cfg(feature = "poem")]
53pub use web::poem::FileServer as PoemFileServer;