Skip to main content

Crate ggen_utils

Crate ggen_utils 

Source
Expand description

§ggen-utils - Shared utilities for ggen project

This crate provides common utilities used across the ggen codebase, including:

  • Error handling types and utilities
  • Application configuration management
  • Logging infrastructure
  • Alert system for critical notifications
  • Project configuration types
  • Time utilities
  • Type definitions and helpers
  • User level management

§Examples

§Error Handling

use ggen_utils::error::Result;
use ggen_utils::error::Error;

fn process_data() -> Result<()> {
    // Operations that may fail
    Ok(())
}

process_data()?;

§Configuration

use ggen_utils::app_config::AppConfig;

let config = AppConfig::load()?;
println!("Config loaded: {:?}", config);

Re-exports§

pub use error::Context;
pub use error::Error;
pub use error::Result;
pub use safe_path::SafePath;
pub use safe_command::CommandArg;
pub use safe_command::CommandName;
pub use safe_command::SafeCommand;

Modules§

alert
Alert Helpers
app_config
Application configuration management
cli
CLI utility functions for ggen command-line interface
enhanced_error
Enhanced error handling with contextual help and platform-specific fixes
error
Error handling types and utilities
logger
Structured logging infrastructure
path_validator
Comprehensive Path Validation for Security-Critical File Operations
project_config
Project configuration types
safe_command
Safe command execution with validation to prevent command injection attacks
safe_path
Safe path handling with validation to prevent path traversal attacks
time
Time utilities for ggen
types
Common type definitions for ggen
user_level
User experience level tracking for progressive help
versioning

Macros§

alert
Emit an alert with custom severity
alert_critical
Emit a critical alert (🚨)
alert_debug
Emit a debug alert (🔍)
alert_info
Emit an info alert (ℹ️)
alert_success
Emit a success alert (✅)
alert_warning
Emit a warning alert (⚠️)
bail
Return early with an error
breaking_change
Marks a breaking change with migration path
deprecated_since
Deprecation macro with version tracking and migration notes
ensure
Ensure a condition is true, or return early with an error
experimental
Marks a feature as experimental with version tracking