ferrite_config/
lib.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
//! Ferrite Configuration Management
//!
//! This crate provides a type-safe, validated configuration system for the
//! Ferrite image viewer. It handles configuration loading, saving, and
//! validation through a TOML-based file system.
//!
//! # Features
//! - Type-safe configuration with validation
//! - TOML-based storage
//! - Standard configuration paths
//! - Version tracking for compatibility
//! - Comprehensive error handling
//!
//! # Example
//! ```rust,no_run
//! use ferrite_config::FerriteConfig;
//!
//! // Load existing configuration or create default
//! let config = FerriteConfig::load().unwrap_or_default();
//!
//! // Access settings
//! println!("Window borderless: {}", config.window.borderless);
//! println!("Zoom level: {}", config.zoom.max_zoom);
//! ```

// Re-export primary types for user convenience
pub use config::FerriteConfig;
pub use error::{ConfigError, Result};

// Re-export configuration component types
pub use indicator::IndicatorConfig;
pub use input::ControlsConfig;
pub use window::WindowConfig;
pub use zoom::ZoomConfig;

// Re-export common types used in configuration
pub use types::{Color32, ColorRGBA, Corner, Key, MouseButton, Vector2D};

// Version information
pub const VERSION: &str = env!("CARGO_PKG_VERSION");
pub const CONFIG_VERSION: &str = "0.1";

// Internal modules
mod config;
mod defaults;
mod error;
mod indicator;
mod input;
mod navigation;
mod types;
mod window;
mod zoom;