Skip to main content

oxigdal_dev_tools/
lib.rs

1//! Development tools for OxiGDAL
2//!
3//! This crate provides various development utilities for working with OxiGDAL:
4//!
5//! - **Profiler**: Performance profiling and analysis
6//! - **Debugger**: Debugging utilities and helpers
7//! - **Validator**: Data validation and integrity checking
8//! - **Inspector**: File format inspection and analysis
9//! - **Generator**: Test data generation
10//! - **Benchmarker**: Quick benchmarking tools
11//!
12//! # Example
13//!
14//! ```rust,no_run
15//! use oxigdal_dev_tools::{profiler::Profiler, inspector::FileInspector};
16//!
17//! # fn main() -> Result<(), Box<dyn std::error::Error>> {
18//! // Profile some operation
19//! let mut profiler = Profiler::new("my_operation");
20//! profiler.start();
21//! // ... do work ...
22//! profiler.stop();
23//! println!("{}", profiler.report());
24//!
25//! // Inspect a file
26//! let inspector = FileInspector::new("/path/to/file.tif")?;
27//! println!("{}", inspector.summary());
28//! # Ok(())
29//! # }
30//! ```
31
32#![warn(missing_docs)]
33#![warn(clippy::unwrap_used)]
34#![warn(clippy::panic)]
35
36pub mod benchmarker;
37pub mod debugger;
38pub mod generator;
39pub mod inspector;
40pub mod profiler;
41pub mod validator;
42
43use thiserror::Error;
44
45/// Result type for dev tools operations
46pub type Result<T> = std::result::Result<T, DevToolsError>;
47
48/// Error types for dev tools
49#[derive(Error, Debug)]
50pub enum DevToolsError {
51    /// IO error
52    #[error("IO error: {0}")]
53    Io(#[from] std::io::Error),
54
55    /// Profiler error
56    #[error("Profiler error: {0}")]
57    Profiler(String),
58
59    /// Validator error
60    #[error("Validation error: {0}")]
61    Validation(String),
62
63    /// Inspector error
64    #[error("Inspector error: {0}")]
65    Inspector(String),
66
67    /// Generator error
68    #[error("Generator error: {0}")]
69    Generator(String),
70
71    /// Benchmarker error
72    #[error("Benchmarker error: {0}")]
73    Benchmarker(String),
74
75    /// OxiGDAL core error
76    #[error("OxiGDAL error: {0}")]
77    OxiGdal(#[from] oxigdal_core::error::OxiGdalError),
78
79    /// Serialization error
80    #[error("Serialization error: {0}")]
81    Serialization(#[from] serde_json::Error),
82}