freemarker 0.1.1

Apache FreeMarker 语义兼容的 Rust 模板引擎(freemarker-core 迁移)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//! 不支持的数字类异常 —— 对应 Java
//! `freemarker.template.utility.UnsupportedNumberClassException`
//! (数字模型背后的 Java 数字类型不受支持)

use std::fmt;

/// 不支持的数字类异常(对应 UnsupportedNumberClassException.java)
#[derive(Debug, Clone, PartialEq, Eq)]
pub struct UnsupportedNumberClassException(pub String);

impl fmt::Display for UnsupportedNumberClassException {
    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
        write!(f, "Unsupported number class: {}", self.0)
    }
}

impl std::error::Error for UnsupportedNumberClassException {}