rok-utils 0.2.2

Laravel/AdonisJS-inspired utility helpers for the Rok ecosystem
Documentation
//! Error handling with AdonisJS-inspired typed errors.
//!
//! This module provides the `RokError` enum with machine-readable error codes
//! and HTTP status semantics.
//!
//! # Error Codes
//!
//! | Code | Status | Description |
//! |------|--------|-------------|
//! | `E_NOT_FOUND` | 404 | Resource not found |
//! | `E_UNAUTHORIZED` | 401 | Authentication required |
//! | `E_FORBIDDEN` | 403 | Access denied |
//! | `E_VALIDATION_FAILURE` | 422 | Input validation failed |
//!
//! # Example
//!
//! ```rust
//! use rok_utils::{RokError, RokResultExt};
//!
//! fn find_user(id: u64) -> Result<String, RokError> {
//!     if id == 42 {
//!         Ok("Alice".to_string())
//!     } else {
//!         Err(RokError::NotFound(format!("User #{id}")))
//!     }
//! }
//!
//! let result = find_user(42).context("Database query failed");
//! assert!(result.is_ok());
//! ```

pub mod context;
pub mod kinds;

pub use context::wrap_error;
pub use kinds::{ResultExt, RokError};