pub type Hatch<T> = Result<T, Yoshi>;Expand description
Ergonomic type alias for Result<T, Yoshi> with thematic naming.
This type alias provides expressive naming that aligns with the Yoshi metaphorical
framework while maintaining zero-cost abstraction guarantees. It automatically
adapts between std::result::Result and core::result::Result based on features.
§Performance Characteristics
- Time Complexity: O(1) for all operations (zero-cost abstraction)
- Space Complexity: Identical to
Result<T, Yoshi>(no overhead) - Memory Layout: Exact same representation as standard
Result
§Examples
use yoshi_std::{Hatch, Yoshi, YoshiKind};
fn load_config() -> Hatch<String> {
Ok("configuration data".into())
}
fn process_data() -> Hatch<u32> {
Err(Yoshi::new(YoshiKind::Internal {
message: "processing failed".into(),
source: None,
component: None,
}))
}Aliased Type§
pub enum Hatch<T> {
Ok(T),
Err(Yoshi),
}