pub type Result<T> = Result<T, EngineError>;Expand description
A specialized Result type for StaticWeaver operations.
This type is used throughout the StaticWeaver library for any operation that
can produce an EngineError.
§Examples
use staticweaver_core::error::Result;
use staticweaver_core::EngineError;
fn check(input: &str) -> Result<usize> {
if input.is_empty() {
Err(EngineError::InvalidTemplate("empty".to_string()))
} else {
Ok(input.len())
}
}
assert_eq!(check("hello").unwrap(), 5);
assert!(check("").is_err());Aliased Type§
pub enum Result<T> {
Ok(T),
Err(EngineError),
}