#settings #image-viewer #ferrite

bin+lib ferrite-config

Configuration management for Ferrite image viewer

5 releases

new 0.1.5 Dec 20, 2024
0.1.4 Dec 18, 2024
0.1.3 Dec 18, 2024
0.1.2 Dec 16, 2024
0.1.1 Dec 15, 2024

#332 in Configuration

Download history 347/week @ 2024-12-13

347 downloads per month
Used in 3 crates

GPL-3.0-or-later

36KB
800 lines

Ferrite Config

Configuration management for the Ferrite image viewer.

Features

  • TOML-based configuration file
  • Standard XDG configuration paths
  • Sensible defaults
  • Serialization/deserialization support

Usage

use ferrite_config::FeriteConfig;

// Load existing config
let config = FeriteConfig::load().unwrap_or_default();

// Save config
config.save().expect("Failed to save config");

// Access settings
println!("Cache size: {}", config.cache_size);
println!("Default zoom: {}", config.default_zoom);

lib.rs:

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

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);

Dependencies

~10–31MB
~458K SLoC