thymeleaf 0.1.0-beta.0

A framework-neutral Thymeleaf-compatible dynamic template engine for Rust
Documentation
use crate::util::{CharSequenceValue, TextUtilsError, Utf16String};

use super::ITemplateEvent;

/// 包含 `<!--` 与 `-->` 边界的不可变注释事件。
///
/// 对应 Java: `org.thymeleaf.model.IComment`。
pub trait IComment: ITemplateEvent + CharSequenceValue {
    /// 返回引擎内建 Comment,供 Processor 保留 parser 原始前后缀。
    fn as_engine_comment(&self) -> Option<&crate::engine::Comment> {
        None
    }

    /// 返回包含前后缀的完整注释。
    fn get_comment(&self) -> Result<Option<Utf16String>, TextUtilsError>;

    /// 返回不含前后缀的注释内容。
    fn get_content(&self) -> Result<Option<Utf16String>, TextUtilsError>;
}