pub type Result<T> = Result<T, HtmlError>;Expand description
Type alias for a result using the HtmlError error type.
This type alias makes it more convenient to work with Results throughout the library, reducing boilerplate and improving readability.
§Examples
use html_generator::error::{HtmlError, Result};
fn parse(input: &str) -> Result<usize> {
if input.is_empty() {
return Err(HtmlError::InvalidInput("empty".into()));
}
Ok(input.len())
}
assert_eq!(parse("hi").unwrap(), 2);
assert!(parse("").is_err());Aliased Type§
pub enum Result<T> {
Ok(T),
Err(HtmlError),
}